How to change the System name on WB Project page using the Mechanical ACT console?
import wbjn ScriptCmds = """ for index, system in enumerate(GetAllSystems()): system.DisplayText = "MySystem_%s" % index """ wbjn.ExecuteCommand(ExtAPI, ScriptCmds)
This works only within the workbench scripting console/shell:
for index, system in enumerate(GetAllSystems()): system.DisplayText = "MySystem_%s" % index
This works only within the Mechanical :
def Test(): ScriptCmds =r""" for index, system in enumerate(GetAllSystems()): system.DisplayText = "System_%s" % index """ import wbjn wbjn.ExecuteCommand(ExtAPI, ScriptCmds) thread=System.Threading.Thread(System.Threading.ThreadStart(Test)) thread.Start()