Export and Re-Export CAD Assembly

About CAD Export

This section explains at a high level how to export CAD assemblies from CAD platforms supported by the SimMechanics™ Link utility.

Requirements for Export with a Supported CAD Platform

The SimMechanics Link Reference documentation presents platform-specific information on:

  • Linking a supported CAD platform with the SimMechanics Link utility

  • Finding, changing, and applying export settings

  • Exporting assemblies in the Physical Modeling XML format through the CAD platform interface

Requirements for Export with an Unsupported CAD Platform

If the SimMechanics Link utility does not support your CAD platform, you can still export assemblies to Physical Modeling XML. In this case, must construct a custom exporter that utilizes the SimMechanics Link application program interface (API).

Configure SimMechanics Link in Supported CAD Platforms

Once it is linked to the SimMechanics Link utility, each CAD platform's interface has a SimMechanics Link menu that allows you to access the export settings pane or dialog box. Before you export an assembly, you can check, change, and apply the export settings.

Open Settings Pane or Dialog Box

  1. Open your CAD assembly.

  2. From the CAD platform's SimMechanics Link menu, open the settings interface.

At any time, you can:

  • Apply your settings.

  • Cancel your settings. You lose whatever new settings you have entered.

Configure Export Tolerances

In the settings interface, you can configure one or more of the export tolerances. Geometric and numerical differences smaller than the tolerances are treated as zero.

  • Linear tolerance specifies the smallest significant difference in length.

  • Angular tolerance specifies the smallest significant difference in angle.

  • Relative roundoff specifies the smallest significant numerical difference.

Configure Reference Coordinate Systems for Export

In the export coordinate systems interface, you can require the export of all, some, or none of the reference coordinate systems in your assembly. You control selective export by adding a distinctive prefix to the names of assembly coordinate systems that you want to export.

  • You can export all the reference coordinate systems by choosing export and specifying no prefix.

  • You can export some of the reference coordinate system by choosing export and specifying a prefix. Reference coordinate systems labeled by names with that prefix are exported.

  • You can also choose not to export any reference coordinate systems.

For example, if your assembly has 11 reference coordinate systems (five with names beginning with A_, three with names beginning with B_, and three with names beginning with C_), you can choose to export:

  • All 11 coordinate systems by specifying no prefix.

  • The five coordinate systems with names prefixed by A_ by specifying the prefix A_.

  • The three coordinate systems with names prefixed by B_ by specifying the prefix B_.

  • The three coordinate systems with names prefixed by C_ by specifying the prefix C_.

    Note:   Your CAD platform and SimMechanics Link interface might not support inserting and exporting reference coordinate systems. For details, consult the SimMechanics Link Reference Documentation.

Apply Export Settings

Apply your export settings by clicking the OK button in the settings pane or dialog box. The settings interface closes.

Generate Physical Modeling XML File

To complete export of the assembly to a Physical Modeling XML file:

  1. If you changed the assembly or any subassemblies, you must rebuild the assembly and resave it in its native format before exporting it to XML.

  2. Export the assembly through the CAD platform's SimMechanics Link interface.

    The assembly is saved in a new form as an XML file. The exporter displays a dialog box when it is finished.

The default XML file name and folder are the same as those of the CAD assembly file. With the export interface, you can change the XML file name and folder if you want.

Automatic Export of STL Files

In addition to the XML file, the exporter creates a stereolithographic (STL) file for each part in the assembly that represents the part's body surface geometry.

  • The STL files automatically receive names based on their respective part names in the assembly.

  • The STL files are saved in the folder where the XML file is saved.

Re-Export Assembly After Changes

The results of a CAD export are changed if you:

Re-exporting an assembly after such changes is, by default, identical to the initial export steps. See Generate Physical Modeling XML File. With no changes to the XML file save procedure, your re-export overwrites the existing XML and STL files with the same names.

    Tip   For later use and comparison, you might want to preserve the older XML and STL files.

    • You can use the old folder and give the re-exported XML file a new name. The exporter still overwrites the old STL files.

    • You can use a new folder and avoid overwriting any old files.

Consequences of Re-Exporting Assemblies for Generated Models

While the re-export procedure is the same as, or only slightly different from, the initial export, the resulting new Physical Modeling XML file represents a revised CAD assembly, not a new assembly. To import this XML file with the SimMechanics importer requires choosing how to implement the revisions:

  • Create a new SimMechanics model

  • Update an existing generated SimMechanics model

You can make more detailed adjustments to the second choice as well, using the persistent properties that the XML file retains when you revise and re-export an existing assembly. See Retranslate CAD Assembly.

Export Robot Arm Assembly

In this example, you export a CAD assembly for the first time into Physical Modeling XML.

  1. From the SimMechanics Link demos folder, open the robot arm assembly file, robot.ASSEMBLYFILETYPE, using a supported CAD platform linked to the SimMechanics Link utility.

    The example CAD files are under $matlabroot/toolbox/physmod/smlink/smlinkdemos/, in the subfolder appropriate to your supported CAD platform. The file extensions of these files are specific to each CAD platform.

  2. If you want, open the settings pane or dialog box from the SimMechanics Link menu in your CAD interface. See Configure SimMechanics Link in Supported CAD Platforms.

    Make any adjustments you want to the export settings and apply the settings. The settings interface closes.

  3. From the CAD platform's SimMechanics Link menu, open the export interface.

  4. Change to a different folder to export the XML file. Leave the file name as the default, robot.xml.

  5. Start the export. The exporter begins converting and saving the XML file. When export is complete, a message appears notifying you of export completion.

The XML file is saved to the folder you chose. The exporter also automatically writes the stereolithographic (STL) body surface geometry files to the folder you choose.

Re-Export a Robot Arm Assembly After Changes

In this example, you re-export the robot arm CAD assembly after making some changes. You save the new version of the XML file under a new name, but overwrite the old stereolithographic (STL) files.

With the assembly open from your CAD platform interface:

  1. Open the export interface from the SimMechanics Link menu. Remain in the same folder in which you saved the original exported files.

  2. Change the exported file name to robot1.xml.

  3. Start the export.

The new XML file, with the new name, is saved in the same folder as the original export. The exporter overwrites the old stereolithographic files with new ones, named with the same names.

Was this topic helpful?