Skip to content

Instantly share code, notes, and snippets.

@zihotki
Created September 12, 2023 10:54
Show Gist options
  • Save zihotki/d52a232791a487362bac07916b311354 to your computer and use it in GitHub Desktop.
Save zihotki/d52a232791a487362bac07916b311354 to your computer and use it in GitHub Desktop.
freecad export multiple parts
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment