If you have not yet installed and enabled the Simscape™ Multibody™ Link plug-in on your device, before continuing see Install the Simscape Multibody Link Plug-In.
You can access the export menu from the CAD application menu bar whenever a CAD assembly model is open. The location of the menu can vary with the CAD software version but it is generally under Add-Ins for Autodesk Inventor® software and under Tools for PTC® Creo™ and SolidWorks® software.
Your Simscape Multibody Link installation comes with a number of CAD assembly models that you can use as export examples. You can find the models in the folders:
matlabroot\toolbox\physmod\smlink\smlinkdemos\cadPlatform\modelFolder
matlabroot — MATLAB® root
folder, for example, C:\Programs\MATLAB\
. Use the matlabroot
command
at the MATLAB command prompt to determine your MATLAB root
folder.
cadPlatform is an identifier for
your CAD application—inventor
for Autodesk
Inventor, proe
for PTC Creo,
and sw
for SolidWorks.
modelFolder is the model name or
abbreviation—robot
for a robotic arm model
and stewart
for a Stewart platform model (available
only for SolidWorks and PTC Creo applications). Ignore
the remaining folders.
For example, if your MATLAB root folder is C:\Programs\MATLAB
,
your CAD application is SolidWorks, and the model that you’d
like to open is robot
, then you can open the mode
from the folder:
C:\Programs\MATLAB\toolbox\physmod\smlink\smlinkdemos\sw\robot
Open the assembly model to export. Note that part models are not supported and that the Simscape Multibody Link export menu is not accessible if an assembly model is not open.
From the CAD export menu, select the option to export the model.
Specify the XML multibody description file name and folder. The Simscape Multibody Link plug-in generates the XML file and the part geometry files needed to render the model once imported.
Use the smimport
function with the name of the
XML multibody description file as an argument to import the CAD assembly into the
Simscape
Multibody modeling environment. The function parses the file and uses the data
contained therein to generate a Simscape
Multibody block diagram and an accompanying MATLAB data file. See Import a CAD Assembly Model (Simscape Multibody).
This content refers to Simscape Multibody First Generation software. First-generation features are slated to be deprecated and should be avoided. To prevent compatibility issues in future releases, the Simscape Multibody Link plug-in no longer supports the translation of CAD models into Simscape Multibody First Generation models.