Documentation Center

  • Trial Software
  • Product Updates

Design Custom Exporter Module

Prerequisites for Custom Exporter Modules

A custom exporter module works with intermediate representations of CAD assembly data. For an overview of the types of CAD assembly and SimMechanics™ Link data and their relationship, see Custom Translation into Physical Modeling XML Format preceding.

A custom exporter module:

  • Issues function calls to the APIs of both the CAD platform and the SimMechanics Link utility.

  • Transfers assembly representation data from the assembly, through the CAD API, to the Physical Modeling XML file, through the SimMechanics Link API.

Custom Exporter Module Communicates with APIs (Detail)

Using the SimMechanics Link API Functions

The SimMechanics Link API is a library of API functions that you call to construct a unified, selective representation of an assembly and write it as an XML file. Program Custom Exporter with SimMechanics Link API following describes how to create, compile, and execute custom exporter modules in C/C++ with the SimMechanics Link API function library.

Implementing Translation with CAD and SimMechanics Link APIs

Extracting Selective CAD Assembly Data

To extract the selected assembly data required for export, consult your CAD platform API documentation and determine which functions of the CAD platform API you need to accomplish this.

Constructing the Intermediate API Representation

To construct the intermediate representation of an assembly, use the following functions from the SimMechanics Link API, in the order shown. The API also contains other functions you might need in special cases. For more information, consult the SimMechanics Link Reference documentation.

StepTo...Use SimMechanics Link API Function......and SimMechanics Link API Objects
1.Set length and mass units for CAD assembly. The defaults are meters (m) and kilograms (kg), respectively.pmit_set_units
2.a. Create CAD model object to contain data for CAD assemblypmit_create_cadmodelPmitCadModelH
b. Create API representation translator objectpmit_create_cad2smPmitCad2SMH
3.Set translational, rotational, and numerical tolerances for CAD assemblypmit_set_tolerancesPmitCad2SMH
4.a. Create object to contain data for CAD subassemblies and partspmit_create_cadmodelPmitCadModelH
b. Create reference to CAD model objectpmit_create_cadmodelrefPmitCadModelH, PmitCadModelRefH
c. Add reference within existing CAD model object to child model object by adding transformpmit_add_refincadmodelPmitCadModelH, PmitCadModelRefH
5.a. Create object to contain data for CAD assembly component (part or rigid subassembly)pmit_create_assemcompPmitAssemCompH
b. Add reference within existing CAD model object to child assembly component objectpmit_add_refincompPmitAssemCompH, PmitCadModelRefH
6.a. Create object to contain data for constraint between CAD components (parts or rigid subassemblies)pmit_create_constrainPmitAssemCompH, PmitConstrainH,
PmitConstrainType, PmitGeomType
b. Add constraint object to CAD model objectpmit_add_constrainPmitCadModelH, PmitConstrainH

Export Intermediate API Representation into Physical Modeling XML

To export the selective representation of your assembly into a Physical Modeling XML file, use the following functions from the SimMechanics Link API, in the order shown.

StepTo...Use SimMechanics Link API Function......and SimMechanics Link API Objects
1.Enable translation of CAD assembly data into SimMechanics modelpmit_create_cad2smPmitCad2SMH
2.Write Physical Modeling XML file from selective CAD representation of assemblypmit_write_xmlPmitCad2SMH

For detailed information on the programming of a custom export module with the SimMechanics Link API, see Program Custom Exporter with SimMechanics Link API

Was this topic helpful?