Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@fsantini
Created January 10, 2015 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fsantini/b724853f027a95b34e08 to your computer and use it in GitHub Desktop.
Save fsantini/b724853f027a95b34e08 to your computer and use it in GitHub Desktop.
FreeCAD macro for deleting a group object together with its children
import Part, FreeCAD, math, PartGui, FreeCADGui
from FreeCAD import Base, Console
def delWithChildren(obj):
doc = FreeCAD.ActiveDocument
for o in obj.OutList:
delWithChildren(o)
doc.removeObject(obj.Name)
sel = FreeCADGui.Selection.getSelection() # " sel " contains the items selected
for obj in sel:
delWithChildren(obj)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment