MotorCAD API#

class ansys.motorcad.core.motorcad_methods.MotorCAD(port=-1, open_new_instance=True, enable_exceptions=True, enable_success_variable=False, reuse_parallel_instances=False, keep_instance_open=False, url='')#

Connect to an existing Motor-CAD instance or open a new instance.

Parameters:
portint, default: -1

Port to use for communication.

open_new_instanceBoolean, default: True

Open a new instance or try to connect to an existing instance.

enable_exceptionsBoolean, default: True

Whether to show Motor-CAD communication errors as Python exceptions.

enable_success_variableBoolean, default: False

Whether Motor-CAD methods return a success variable (first object in tuple).

reuse_parallel_instancesBoolean, default: False

Whether to reuse Motor-CAD instances when running in parallel. You must free instances after use.

keep_instance_openBoolean, default: False

Whether to keep the Motor-CAD instance open after the instance becomes free.

url: string, default = “”

Full url for Motor-CAD connection. Assumes we are connecting to existing instance.

Returns
——-
MotorCAD object.