Hi,
for executing an existing mechanical code, you should be able to use python code object in your model:
https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v231/en/wb_sim/ds_python_code_Event.html
Also, to send Mechanical commands from the workbench you can use:
If the ACT python commands are directly being sent without an extension one can use the SendCommand API https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v231/en/wb2_js/ContainerName30.html:
system = GetSystem(Name=”SYS”) # Specify system name, or
#system = GetAllSystems()[0] # get first system
model = system.GetContainer(ComponentName=”Model”)
model.SendCommand(Language=”Python”, Command=string)
If the python commands that are being sent from Workbench Journal are a part of a Mechanical extension, then use the following commands:
string=”’ExtAPI.ExtensionManager.GetExtensionByName(‘Extension name’).ScriptScope.My_Python_command()”'
model.SendCommand(Language=”Python”, Command=string)
-Aniket
How to access Ansys help links
Guidelines for Posting on Ansys Learning Forum