Component Object Model
COM is an interface standard for software components that Microsoft introduced in 1993. It enables inter-process communication and dynamic object creation in a wide range of programming languages. COM is the basis for several other Microsoft technologies and frameworks, including OLE, ActiveX, DCOM and other. You can get more information about COM in
Wikipedia and on
Microsoft Windows Developer web site.
The PTC Mathcad Prime API is based on COM, allowing you to use a variety of programming languages, such as C++, C#, VB, VB Script, and JavaScript, to build applications. The API mostly adheres to the Mathcad user interface as a topology. You start with the application, load a worksheet, set and get values (scalar, vector or matrix), save worksheets, and close the application.
Using the automation commands, you can:
• Send data or assign variable values to Mathcad from another application. When sending data to the API, ensure that this data adheres to the PTC Mathcad Prime rules for naming variables and functions.
• Open, execute, or close Mathcad worksheets
• Send results back to the original application
The PTC Mathcad Prime API is a programmatic interface to control and manipulate the contents for a working Mathcad worksheet. All variables and results to be manipulated must be defined as either an Input or an Output. This is done through the PTC Mathcad Prime user interface.
To use the API, write a program in an application that can serve as an automation client, such as Microsoft Excel. The program you write defines and retrieves variables in PTC Mathcad Prime worksheets. The variables defined in and retrieved from PTC Mathcad Prime can be complex scalars, strings, or matrices.
This Guide consists of a collection of code examples using many of the mentioned languages. The examples demonstrate the API capabilities, including new concepts that were not possible with the Mathcad 15 API.
The PTC Mathcad Prime API introduces a new collection set, where you can change many values and send them at once, determine how long to wait, and grab the results. It also introduces SExpression, a string that represents the internal syntax of an equation. It allows you to read, parse, and rewrite equations using the API. PTC Mathcad Prime API also allows you to set and retrieve values in different units.