Run SpaceClaim .scscript script from ANSYS Workbench Journal File.

  • 60 Views
  • Last Post 25 March 2020
ellecapp posted this 28 February 2020

Hi everyone,

I'm trying to automatize the workbench setup and simulation running.

I've prepared a .scscript that works properly in SpaceClaim. Now I want to run this script from a Workbench Journal file.

I've written these lines for the Workbench Journal file but it doesn't generate the geometry:

system1 = GetSystem(Name="Geom")

geometry1 = system1.GetContainer(ComponentName="Geometry")

geometry1.Edit(Interactive=False)

geometry1.Edit(IsSpaceClaimGeometry=True)

DSscript = open("C:\Users\%my_path%\script_v2.scscript")

DSscriptcommand = DSscript.read()

DSscript.close()

geometry1.SendCommand(Command = DSscriptcommand)

geometry1.Exit()

 

Do you know how to do it?

 

Many Thanks!

Order By: Standard | Newest | Votes
Kremella posted this 16 March 2020

Hello,

I'd recommend trying to record a journal as opposed to starting from scratch. Please use the Discovery AIM and Workbench Scripting Guide for detailed help on how to script in WB?

Here is a link to the WorkBench users guide which discusses how to record journal files on WB.

https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v201/en/wb2_help/wb2h_usingjands.html

Here is a link to the Discovery AIM and Workbench Scripting Guide.

https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v201/en/wb2_js/wb2_js.html

Unfortunately, as per our support policy, we will not be able to debug custom scripts on the community.

If you are having issues with opening these links - here is a post you should refer to.

https://studentcommunity.ansys.com/thread/how-to-access-the-ansys-online-help/

I hope this helps.

Thank you.

Best Regards,

Karthik

atulsingh92 posted this 25 March 2020

No it doesn't help,

I too tried the following

where 

I want space claim to open a .pmdb format and save it in scdoc format from workbench. For this I

1) Start Record workbench journal - load a geometry standalone -> open spaceclaim - > file, open my pmdb file -> save in scdoc file ->  stop recording the journal.

 

I get the following output

 

# encoding: utf-8
# 2019 R2
SetScriptVersion(Version="19.4.159")
template1 = GetTemplate(TemplateName="Geometry")
system1 = template1.CreateSystem()
geometry1 = system1.GetContainer(ComponentName="Geometry")
geometry1.Edit(IsSpaceClaimGeometry=True)

 

The point I am trying to make is, it (the workbench scripting), did not record either my load pmdb file , or my save scdoc step.

 

How can I get this from workbench scripting.?

Close