With custom functions, you can extend the functionality of PTC Mathcad Prime by writing your own customized functions. Your custom functions behave like PTC Mathcad Prime built-in functions. A custom function carries the Function label and can have many of the same features as PTC Mathcad Prime built-in functions, such as customized error messages, interruption, and exception handling in case of overflow and divide by zero. Custom functions are allowed to pass complex scalars, complex matrices, and string variable types. You can group a set of custom functions in a Dynamic Link Library (DLL). A DLL that groups several custom functions is called an extension.
Default Custom Functions
PTC Mathcad Prime installs a default Custom Functions folder. This folder contains the following items:
• Three subfolders that contain the source code for the sample functions
• MCADINCL.H—A header file for compiling the functions
• mcaduser.lib—A library file for linking the functions
Creating New Custom Functions
The process of creating user custom functions involves the following steps:
• Writing the source code in C or C++ (or wrapping Fortran code in a C wrapper)
• Compiling the source code using a compiler such as Visual C++
• Linking the object files using the MCADUSER.LIB library to create a DLL
• Placing your DLL in the Custom Functions folder.
Terms of Use
You can use the DLL interface specifications for creating customized external functions that work with PTC Mathcad only for your personal or internal business use. These specifications may not be used for creating external functions for commercial resale without prior written consent from PTC. See PTC Customer Agreement for details.