The below code is trying to send commands via system A (SYS) and its Mechanical scripting console and into another system (say system B / SYS 1), but does not work. It is due to the wbcmd string that seems ok formatted but still does not work. Any help is much appreciated.
import System
from System.Threading import *
def RunWBJN(cmds):
def Internal_RunWBJN():
import wbjn
wbjn.ExecuteCommand(ExtAPI,cmds)
thread = System.Threading.Thread(System.Threading.ThreadStart(Internal_RunWBJN))
thread.Start()
wbcmd = '''
system2 = GetAllSystems()[1]
system2.DisplayText = "my name17"
model2 = system2.GetContainer(ComponentName="Model")
mcmd="""
f=ExtAPI.DataModel.Project.Model.Analyses[0].AddForce()
"""
model2.SendCommand(Language="Python", Command=mcmd)
'''
RunWBJN(wbcmd)