Change System names
Options
![Erik Kostson](https://us.v-cdn.net/6037473/uploads/avatarstock/nXPEHISZX7D4V.png)
Erik Kostson
Member, Employee Posts: 165
How to change the System name on WB Project page using the Mechanical ACT console?
Tagged:
0
Best Answer
-
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()
2
Answers
-
import wbjn
ScriptCmds = """
for index, system in enumerate(GetAllSystems()):
system.DisplayText = "MySystem_%s" % index
"""
wbjn.ExecuteCommand(ExtAPI, ScriptCmds)0