Hi all.
I'm working on a personal project with contains many parts which I've created, around 25 parts. However, manually exporting each part to prepare my releases takes a while. Is there a Python script or any other method which I can run which automatically exports each part into a STL/STEP file, ready for 3D printing?
Thanks
Python script to automatically generate Step files
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Python script to automatically generate Step files
How are defined your 'parts'? Are these Part containers? Or just all top level objects? Or specific names?
Re: Python script to automatically generate Step files
Hi, thanks for the reply. They are specific names. There are no components, just used parts design -> and created a body for my part
Re: Python script to automatically generate Step files
It will be possible to generate automatically files from parts.
I use it to generate STL starting from drawings, but I'm coding all the models too.
What you are searching for is similar to this workflow?
Carlo D.
I use it to generate STL starting from drawings, but I'm coding all the models too.
What you are searching for is similar to this workflow?
- select all the objects
- invoke a Macro
- Macro will generate STEP files starting from selected objects
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: Python script to automatically generate Step files
Say you want to export each Body in a separate STEP :
Code: Select all
for obj in App.ActiveDocument.findObjects('PartDesign::Body'):
obj.Shape.exportStep(f"/tmp/{obj.Label}.stp")