The Siemens Community Catalyst program was co-created with our community to acknowledge technology leaders who consistently contribute to the Siemens Community. Nominations are accepted on a rolling basis.
There is a Javascript help for some functions in SIMSOLID. How can we access other functions such as copying analyses, applying boundary conditions etc via Javascript objects ?
Hi Saash,
In SimSolid, the JavaScript API provides programmatic access to certain modeling and analysis functions, but not all GUI features are exposed directly. While the help documentation covers some functions, other actions such as copying analyses, applying boundary conditions, or modifying loadscan often be accessed via JavaScript objects representing the model, parts, and analyses. You can explore available methods by opening the Script Console in SimSolid and using commands like console.log(Object.keys(simsolid)) or inspecting objects returned by simsolid.getModel() to see what functions are available. For more advanced operations, you may need to combine existing API methods for example, creating a new analysis object and programmatically adding boundary conditions by referencing part nodes or faces since there is currently no single direct function for some GUI actions.
You can explore available methods by opening the Script Console in SimSolid and using commands like console.log(Object.keys(simsolid)) or inspecting objects returned by simsolid.getModel() to see what functions are available.
How do you open the Script console in Simsolid?
So when I said: “opening the Script Console”, in practical terms it means running a JavaScript script that logs the objects (like simsolid and simsolid.getModel()) so you can see what functions exist. There’s no separate interactive console window inside the GUI.
The typical way to run JavaScript and inspect objects is via batch execution of .js files from the command line using -s, and logging results with console.log(...). You can explore object keys and available functions once you’re in that scripting context.
link: https://help.altair.com/ss/en_us/topics/simsolid/get_started/command_line_simsolid_r.htm
Hi SouravDas0306,
Can you demo it with a simple example ?
,Below is a simple script I wanted to try ?
// set default units Project.setDefaultUnits({length: 'in', angle: 'deg', force: 'lbf', moment: 'lbf*in'});
// create a new design study var study = Project.addDesignStudy({ file: 'SimSolid/tbu.x_t', reader: 'parasolid', resolution: 'standard' });
// apply material to all parts study.applyMaterial({ material: 'Steel', partNameMask: '*' });
// find all connections automatically study.addConnections({ resolution: 'normal' });
simsolid.getModel(); console.log(Object.keys(simsolid));
Project.save({ file: 'SimSolid/tbu.ssp' });