CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS

Automatically starting a Journal File whenever workbench opens

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 8, 2015, 08:45
Unhappy Automatically starting a Journal File whenever workbench opens
  #1
Member
 
Join Date: Oct 2014
Posts: 44
Rep Power: 12
kar.coep is on a distinguished road
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.
kar.coep is offline   Reply With Quote

Old   August 12, 2015, 22:07
Default
  #2
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14
Kapi is on a distinguished road
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
Kapi is offline   Reply With Quote

Reply

Tags
deign modeler, excel, journal, jscript


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 04:30
what is swap4foam ?? AB08 OpenFOAM 28 February 2, 2016 02:22
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 12:44
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 11:23
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 02:24


All times are GMT -4. The time now is 16:49.