File Exchange

image thumbnail

CAD to MATLAB to Simscape Multibody

version (15.8 MB) by Steve Miller
Export a CAD assembly to a MATLAB data structure and import into a Simscape Multibody model.


Updated 01 Sep 2016

View Version History

View License

This file contains data2smixml(), which is MATLAB code that converts a MATLAB data structure into a Simscape Multibody model. A macro written in Visual Basic extracts CAD assembly information from a SolidWorks assembly into a specific MATLAB data structure. That MATLAB data structure is converted to a Simscape Multibody XML file using the MATLAB function data2smixml(). The resulting Simscape Multibody XML file can be imported into a Simscape Multibody model using smimport().
A Visual Basic macro is provided to show an algorithm for extracting data from a CAD assembly. Assemblies in SolidWorks, Wildfire, Creo (formerly Pro/Engineer), and Inventor can be exported to a SimMechanics XML file using Simscape Multibody Link. If you are using another CAD system, this example can help you write a macro for your CAD system.
Please read the README.txt file to get started.
Watch this video to see how Simscape Multibody Link works

To find other Simscape examples, search for posts with the keyword "physical modeling"

To learn more about MathWorks Simscape Products, go to:

Cite As

Steve Miller (2021). CAD to MATLAB to Simscape Multibody (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (9)

Eric Fricot

Hi all, is someone make a macro to convert autodesk fusion 360 assembly to simscape multibody, this could be great!!! thank in advance

Ahsan Ali

Hi steve miller , hope you will be fine, here I need your help, your blog is very useful but unfortunately I am a user of DS CATIA rather than any other software you mentioned above. Basically I want to export my .cat product file as .xml so as to analyze it deeply in matlab but failed to do so. Can you please guide me what should i do for this....Thanx

Sala Darenfed

Martin Stangl

Does anyone has a customised version based on the great plugin for SolidEdge?


Hi Steve,

Thanks for sharing your great work. I was wondering if we could extend your approach to Catia assemblies (CATProduct) as there is no added value to reproduce the model in Simscape multibody.

Thanks for giving me some clues.



Johann Wiens

Johann Wiens



MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!