Skip to main content

Posts

Showing posts from September, 2023

Export Multiple Selected to Multiple STEP Files in One Go - FreeCAD Macro

FreeCAD is a powerful open-source CAD tool used by engineers and designers worldwide. If you need to export multiple selected objects to separate files, this handy macro can save you time and effort.  This macro will take the selected objects i.e. a number of separate extrudes that you have ctrl selected from screen, and export them out as individual step files into your chosen directory.  A demonstration of this macro can be found on my youtube channel  https://youtu.be/IapVaYQWN2M . To use the macro take a copy of the below text. Macro Code from PySide import QtGui folder = str(QtGui.QFileDialog.getExistingDirectory(None, "Select Directory")) a = Gui.Selection.getSelection() count = 0 import ImportGui options = None if hasattr(ImportGui, "exportOptions"): options = ImportGui.exportOptions(".step") for b in a: objs = [] objs.append(b) file = folder+"/"+str(count)+".step" ImportGui.export(objs, file, options) count = count + 1 ...