Q. I would like to call ANSYS workbench from the DOS prompt and have it automatically run my customized macro. Similar to how ANSYS works.
Can this be done?

A. Yes. Workbench can be started from the DOS prompt via a script file. Take the following code block, save it to a JScript file - RunWB.js, for example - then launch it from the command line with "cscript.exe RunWB.js".

***********
// Start and run the Workbench
//
var WB = new ActiveXObject("AnsysWB.WB.90");
WB.StartApplet = "DSApplet";
WB.Run(false);

// Get the Simulation applet pointer
//
var DS = WB.AppletList.Applet("DSApplet").App;

// Put your JScript code here
//

// Shut down the executable
//
WB.FileExit();
*****************


Q. I would like to call ANSYS workbench from the DOS prompt and have it automatically run my customized macro. Similar to how ANSYS works.
Can this be done?

A. Yes. Workbench can be started from the DOS prompt via a script file. Take the following code block, save it to a JScript file - RunWB.js, for example - then launch it from the command line with "cscript.exe RunWB.js".

***********
// Start and run the Workbench
//
var WB = new ActiveXObject("AnsysWB.WB.90");
WB.StartApplet = "DSApplet";
WB.Run(false);

// Get the Simulation applet pointer
//
var DS = WB.AppletList.Applet("DSApplet").App;

// Put your JScript code here
//

// Shut down the executable
//
WB.FileExit();
*****************





Show Form
No comments yet. Be the first to add a comment!