Page 1 of 3

Import SolidWorks parts to OpenSim

Posted: Sat Jul 28, 2012 10:56 am
by resodad
Several people have asked on the forum about importing cad models to OpenSim.
Here is my progress so far using SolidWorks.
Transferring whole assemblies is not possible as of version 2.4.

See the attached pdf file for detailed instructions

In this example a part is added to an OpenSim model of the pelvis-femur, Fig. 1. The part is free to rotate.
solidworks part in OpenSim.jpg
solidworks part in OpenSim.jpg (7.07 KiB) Viewed 4805 times
Summary of steps:
Determine the coordinate system used by the OpenSim model.
Design the parts in SolidWorks paying attention to the coordinate system.
Find the mass properties from SolidWorks (Evaluate tab > Mass Properties). Find:
Mass
CG location
Inertia matrix about CG
Add bodies, joints, and coordinates via XML to the OpenSim model.

Re: Import SolidWorks parts to OpenSim

Posted: Wed Aug 01, 2012 9:20 am
by laxdfns15
Great write up. Have you had problems with scaling issues? Any time I draw something in SolidWorks to import into OpenSim I have to scale the geometry down to 0.001 for all x, y, and z to get the correct size. I'm guessing it could be the "Do not translate STL output data to positive space" as I haven't done that when making it an stl file.

Re: Import SolidWorks parts to OpenSim

Posted: Sun Aug 05, 2012 3:53 pm
by resodad
Hi Chris,
Set your units in Solidworks to meters.
The default in SolidWorks is millimeters, and OpenSim uses meters.
Tools > Options... > Document Properties tab > Units > select MKS.
Cheers,
John
setSolidWorksUnits.jpg

Re: Import SolidWorks parts to OpenSim

Posted: Mon Aug 06, 2012 8:44 am
by laxdfns15
John,

That would make sense, wouldn't it.

Thanks,
Chris

Re: Import SolidWorks parts to OpenSim

Posted: Sat Feb 22, 2014 6:15 pm
by rjoy
Hey John,
I followed the instructions you had on the pdf, which were great by the way. Problem is, the CAD part has been uploaded, but the skeletal model has disappeared. Any ideas?

Re: Import SolidWorks parts to OpenSim

Posted: Thu Feb 27, 2014 11:36 am
by aymanh
Hi Ronald,

Could it be a units issue where the size of the part you added is much bigger than the rest of the OpenSim model so the model either ends up too small or embedded inside the imported part? I'd suggest you hide the imported part and see if the model is still visible.

Please let us know how it goes,
-Ayman

Re: Import SolidWorks parts to OpenSim

Posted: Fri Feb 28, 2014 9:47 am
by maryam
Hello
I have Chris's problem and I tried Ayman's suggestion. But the problem has not been solved yet! Do you have any other suggestion Ayman?

Thanks
Maryam

Re: Import SolidWorks parts to OpenSim

Posted: Mon Apr 28, 2014 1:47 am
by davidesimonetti87
Thank you very much for the pdf guide. Because i'm new in XML sector, could you suggest me a free editor to start writing XML?
Regards,
Davide

Re: Import SolidWorks parts to OpenSim

Posted: Mon Apr 28, 2014 10:09 am
by aymanh
Hi Davide,

You can use Notepad++ from http://notepad-plus-plus.org/. Check the documentation page below for more details.

http://simtk-confluence.stanford.edu:80 ... el+Editing

Best regards,
-Ayman

Re: Import SolidWorks parts to OpenSim

Posted: Tue Apr 29, 2014 1:30 am
by davidesimonetti87
Thank you Ayman! I've seen the file and I started using Notepad++. Now i've got another issue: if i have to import a group of parts from Solidworks (.SLDASM), do I have to import one by one or there is a way to get them all together?

Davide