Ansys Learning Forum Forums Discuss Simulation General Mechanical Active mechanical system name in ACT scrippting Reply To: Active mechanical system name in ACT scrippting

IKER GOMEZ
Subscriber

A way of finding the system Name from Mechanical could be based on the WorkingDirectory:
On Mechanical:

WBcmd = “\n” + “SYSFolder=” + “‘” + ExtAPI.DataModel.Project.Model.Analyses[0].WorkingDir.Split(“\\”)[-3] + “‘”
WBcmd =WBcmd + “””
for system in GetAllSystems():
if ACT.GetEntityProperty(system.GetComponent(“Model”),’DirectoryName’) == SYSFolder:
returnValue(system.Name)
“””
system_name=wbjn.ExecuteCommand(ExtAPI,WBcmd)