1. Installing Mathcadpy - MattWoodhead/MathcadPy GitHub Wiki

Requirements

  • Microsoft Windows 7+ (unfortunately the Mathcad Prime COM API is only available on Microsoft Windows)
  • Mathcad Prime 3+ Ensure that you have got PTC Mathcad Prime installed. This wrapper has been tested with Mathcad Prime versions 3, 4 and 5.
  • win32com MathcadPy uses the pywin32 package to interact with the Mathcad COM api. This should automatically be installed when you use pip to install MathcadPy, but you can also install it before hand or use an existing installation such as the Anaconda Distribution.

Installation

MathcadPy has been released on PyPI, so installation is simple as follows:

pip install MathcadPy

Thats it!

Testing the link to Mathcad

Start a fresh python script, and type the following:

from MathcadPy import Mathcad

mathcad_app = Mathcad()  # creates an instance of the Mathcad class - this object represents the Mathcad window

print(f"Mathcad version: {mathcad_app.version}")  # Check the mathcad version and print to the console

Save and then run the script. You should see an output similar to the following in the terminal window:

alt text

Note that there may be a slight delay whilst Mathcad loads if you do not already have it open.