CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSYS (https://www.cfd-online.com/Forums/ansys/)
-   -   Automatically starting a Journal File whenever workbench opens (https://www.cfd-online.com/Forums/ansys/151298-automatically-starting-journal-file-whenever-workbench-opens.html)

kar.coep April 8, 2015 07:45

Automatically starting a Journal File whenever workbench opens
 
Hello,I am trying to open and drive workbench from excel. Currently I have programmed workbench to launch directly from excel (by creating a .wbpj object in excel and using selection.verb command). Is there a command in excel or in workbench that detects the workbench open event and starts the journal file at specific path automatically? Also, how to record design modeler steps for jscript? These steps would include importing a geometry from creo, creating named selection and changing parameter values.Thanks in advance.

Kapi August 12, 2015 21:07

Hi kar.coep

You can run .wbjn file when Workbench is opening by creating a .bat file
Code:

"C:\Program Files\ANSYS Inc\v150\Framework\bin\Win64\RunWB2.exe" -I -R try_file.wbjn
inside this .wbjn ( workbench journal file) you can write code to run your Jscript, something like this,

Code:

# encoding: utf-8
SetScriptVersion(Version="15.0")
template1 = GetTemplate(TemplateName="Mesh")
system1 = template1.CreateSystem()
geometry1 = system1.GetContainer(ComponentName="Geometry")
geometry1.Edit()
script = open('my_geom.js', 'r')
geometry1.SendCommand(Command=script.read())
script.close();
geometry1.Exit()

Similarly you can add your mesh jscript file as well and run one after another.

Quote:

how to record design modeler steps for jscript?
it is not possible to record design modeler steps, you have to create your coordinate file and give it extension of .js and run with above code.


Hope it helps

Cheers
KAPI


All times are GMT -4. The time now is 01:40.