Python: Failed to connect to Motor-CAD instance
Dear forum,
we have been using Motor-CAD 2024.1.3 with Python scripts in the last months.
On the same PC (Windows) Motor-CAD 2024.2.3.1 has now been installed. This seems to lead to some unexpected behavior: when opening the same models and scripts in the same older 2024.1.3 version, the Python scripts suddenly fail at the second line:
Python script Exception: An error occurred in user script.
User Script, line 6, in
mcApp = pymotorcad.MotorCAD()
^^^^^^^^^^^^^^^^^^^^^
Exception: Failed to connect to Motor-CAD instance: port=58016, Url=http://localhost:58016/jsonrpc
We also tried to open everything in the new 2024.2.3.1 but the behavior is the same.
We also checked the menu "Defaults -> Automation" and tried different “registered” versions. Nothing worked.
As soon as we switch to another PC, where Motor-CAD 2024.2.3.1 has not been installed yet, everything works as before. So we are pretty sure that the new Motor-CAD installation causes this and not any change in our environment.
Is there any workaround to make the scripts running again on all machines?
Thank you!