Converting .sldprt to .stl

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
umardastgir
Posts: 32
Joined: Mon Apr 22, 2019 9:29 pm

Converting .sldprt to .stl

Post by umardastgir »

Hello everyone.

Recently I have been working on an assignment to convert five file formats (.dae, .stl, .step, igs, obj) to .stl. Using FreeCAD Python console and help from people on this forum, I was able to do that.

The last part of this assignment is to convert .sldprt (Solidworks Parts File) to .stl. Unfortunately, FreeCAD does not support importing this file format and I can not use its Python console to convert this file format to .stl. Is there another way I can convert .sldprt file to .stl?
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Converting .sldprt to .stl

Post by NormandC »

Not with FreeCAD there isn't. sldprt is a proprietary file format. You need to use another proprietary program, SolidWorks or a competitor, to export it to an open format.

I believe CAD Exchanger can import SW files, and should not cost an arm and a leg. https://cadexchanger.com/products/gui

There's also CAD Exchanger Cloud https://cloud.cadexchanger.com/pricing
umardastgir
Posts: 32
Joined: Mon Apr 22, 2019 9:29 pm

Re: Converting .sldprt to .stl

Post by umardastgir »

Thanks for your response NormandC. I am looking to convert .sldprt to .stl using a Python script, rather than using a user interface.

I did find some resources online (GradCAD, Datakit Cross manager etc.) but all these methods (as far as I know) provide a user interface and not APIs.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Converting .sldprt to .stl

Post by NormandC »

In my opinion, you can forget APIs and using Python. You have a very specific need that is very rare IMO. Python is practically unused in the proprietary commercial world, when CAD programs have programming APIs, it's never Python. Things would be different with open file formats, but as I wrote, sldprt is as closed as it gets.
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Converting .sldprt to .stl

Post by wmayer »

umardastgir wrote: Wed May 01, 2019 7:04 pm Thanks for your response NormandC. I am looking to convert .sldprt to .stl using a Python script, rather than using a user interface.

I did find some resources online (GradCAD, Datakit Cross manager etc.) but all these methods (as far as I know) provide a user interface and not APIs.
CAD Exchanger can also be used from the command line to convert files and Yorik once wrote an add-on to support this inside FreeCAD. See here: https://github.com/yorikvanhavre/CADExchanger
But before buying this application you should double-check that it supports the requested format.
Post Reply