The following is an example of a script that launches multiple JMAG-Designer instances.
※pywin32 must be installed.
import win32com.client
import time
# Get the InstanceManager object of designerstarter
app = win32com.client.Dispatch("designerstarter.Instancemanager.241")
# Get the object of the specified key and launch JMAG-Designer.
designer1 = app.GetNamedinstance(1)
designer2 = app.GetNamedinstance(2)
# Display JMAG-Designer
designer1.Show()
# Load the model into first JMAG-Designer
designer1.Load(r"D:\2D_PM_motor.jproj")
# Display JMAG-Designer
designer2.Show()
# Importing the model into the second JMAG-Designer
designer2.Load(r"D:\3D_PM_motor.jproj")
# Wait 10 seconds
time.sleep(10)
# Closing the first JMAG-Designer
designer1.Quit()
# Terminate the object of the specified key
app.CloseInstance(1)
# Closing the second JMAG-Designer
designer2.Quit()
# Terminate the object of the specified key
app.CloseInstance(2)


