MATLAB Answers


Interaction between MATLAB and SolidWorks.

Asked by MAX3D
on 24 Aug 2012

Hi, support

I work in technical support of SolidWorks and one of my customers that have the need to export files in MATLAB to analyze. I wonder if the program accepts files of my program, as extensions .sldprt or .sldasm, if not, which he accepts CAD files.

Best regards, Cássio Dahmer


Walter Roberson
on 24 Aug 2012

I have now gone through past Questions about connecting Solidworks with MATLAB, and have given them the tag "solidworks".

Vik Sagar
on 8 Dec 2012

Hi Cassio, We wanted something to talk back and forth from SolidWorks to MATLAB in real time rather than one time using XML files. We wanted the changes in MATLAB to be immediately reflected in SolidWorks. We found this tool called CADLab which helped reduce the cycles between SolidWorks and MATLAB. It is available at

Hope that helps out.




2 Answers

Answer by Walter Roberson
on 24 Aug 2012

When I look through past questions, and look at the documentation, it appears to me that there is no provided support for sldprt or sldasm files. What I do see is that SimMechanics can handle STL files and possibly some other types.

Please see for a couple of references.

A past posting of relevance to importing from Solidworks


Answer by ts
on 25 Aug 2012
Edited by ts
on 25 Aug 2012

Hi Cassio,

I am not sure about MATLAB itself, but SimMechanics provides a free utility, called SimMechanics Link, which supports CAD export directly from SolidWorks. After you complete the linking (or registration) steps, the utility functions as an Add-In tool of SolidWorks.

During export, the utility generates one XML file with all necessary assembly and part parameters, and a set of STL files describing the 3-D surface geometry for each CAD part.

Once you've exported the assembly from SolidWorks, you can import the XML and STL files into SimMechanics using a single command. SimMechanics uses the files to automatically generate a model that is equivalent to the original CAD assembly (with some exceptions for assemblies containing unsupported mates).

You can then analyze (and modify) the imported assembly using SimMechanics, Simscape and Simulink blocks as well as MATLAB functions.

To download SimMechanics Link, click here. For information on how to install and register SimMechanics Link, click here.

Hope that helps!

- Tony


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!