In the following procedures, replace:
matlabroot with the root
of your MATLAB® installation.
ARCH with the specific
operating system architecture abbreviation for your system (for example,
To write your C/C++ custom exporter module, use the C header
file located in
This header file contains the function definitions that you follow to call the SimMechanics™ Link API functions from your module. Include this header file in your module C/C++ source code.
In addition to linking your custom module to the SimMechanics Link API, consult your CAD platform's API documentation to determine requirements for linking to the platform's API.
On Windows Platforms. After you compile your module, link it to the binary API function
library located in
On UNIX, LINUX, and Mac Platforms. After you compile your module, link it to the binary API function library:
OS-SPECIFIC-EXTENSION is the API
file extension specific to your operating system.
To determine if you need to include your CAD platform API on the path, consult your CAD platform API documentation.
On Windows. Before you start execution of the module, verify that the folder
on the path.
On UNIX, LINUX, and Mac Platforms. Before you start execution of the module, verify that the folder
included in the system path environment variable
You can find API examples in this folder:
a simple C++ example of a custom module based on the API,
The example custom module converts two CAD parts with one constraint into two SimMechanics bodies and one joint and then writes the result to a Physical Modeling XML file.
The example program defines the CAD assembly data internally, rather than taking the data from a CAD platform through the platform API. Compared to the figure Custom Exporter Module Communicates with APIs (Detail), the leftmost portion of the diagram is missing.
To extend the example module to process real assembly data, add code that calls a CAD platform's API for assembly data to replace the internally defined data.