|On this page…|
This section explains at a high level how to export CAD assemblies from CAD platforms supported by the SimMechanics™ Link utility.
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
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).
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.
Apply your settings.
Cancel your settings. You lose whatever new settings you have entered.
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.
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.
To complete export of the assembly to a Physical Modeling XML file:
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.
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.
The results of a CAD export are changed if you:
Change the assembly or any of its subassemblies or parts
Change the export settings. See Configure SimMechanics Link in Supported CAD Platforms.
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.
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.
In this example, you export a CAD assembly for the first time into Physical Modeling XML.
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.
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.
From the CAD platform's SimMechanics Link menu, open the export interface.
Change to a different folder to export the XML file. Leave the file name as the default, robot.xml.
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.
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.
These changes can include modifications of the assembly or subassembly parts.
They can also include modifications to the export settings. See Configure SimMechanics Link in Supported CAD Platforms.
With the assembly open from your CAD platform interface:
Open the export interface from the SimMechanics Link menu. Remain in the same folder in which you saved the original exported files.
Change the exported file name to robot1.xml.
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.