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:
- port
int
, default: -1 Port to use for communication.
- open_new_instance
Boolean
, default:True
Open a new instance or try to connect to an existing instance.
- enable_exceptions
Boolean
, default:True
Whether to show Motor-CAD communication errors as Python exceptions.
- enable_success_variable
Boolean
, default:False
Whether Motor-CAD methods return a success variable (first object in tuple).
- reuse_parallel_instances
Boolean
, default:False
Whether to reuse Motor-CAD instances when running in parallel. You must free instances after use.
- keep_instance_open
Boolean
, 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.
- port