-
-
Save carlosbaraza/8c91b6dd6f1c977912fec59b3f4a0cd2 to your computer and use it in GitHub Desktop.
FreeCAD macro to export all visible parts as STL. Include all groups children.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Export All STL | |
| # | |
| # This is a small FreeCAD script to export all visible parts in STL | |
| # mesh format. Files will be named as "documentname_partlabel.stl". | |
| # | |
| import FreeCAD | |
| import os.path | |
| doc = FreeCAD.activeDocument() | |
| base_filename = os.path.splitext(doc.FileName)[0] | |
| for obj in doc.Objects: | |
| if obj.ViewObject.Visibility: | |
| filename = base_filename + "_" + obj.Label + ".stl" | |
| obj.Shape.exportStl(filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment