MATLAB: SimMechanics. Import. Solid properties. Simulink

importsimmechanicsSimscape Multibodysimulink

When I import in SimMechanics an assemble (for example from SolidWorks), I need to use some properties (like length, heigth, width and etc.) in other Simulink blocks. In solid properties there aren't any usefull information, only:
Shape : From file
File type : STL
File name : nameofpart
Units : mm
How can I take the information I need (length, heigth, width and etc.)?

Best Answer

For each rigid part in SolidWorks, SimMechanics Link generates an STL file. You also get an XML file which says how the STL files are connected together (rigid transforms/joints) and what the properties (color, mass, etc.) are.
So, that file name in the Solid block, nameofpart.STL, contains all the points and connections that make up the shape of your object.
It's unfortunately not as easy as "length, width, and height" since the STL mesh can represent much more complicated shapes. I suppose, for a rough estimate, you could -- for example -- find the minimum and maximum X coordinates of all the vertices in that file and call that the "length".
- Sebastian