Skip to content

Commit

Permalink
put gears into container if a container is active
Browse files Browse the repository at this point in the history
  • Loading branch information
looooo committed Jun 20, 2020
1 parent 23bd463 commit 0a19329
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions freecad/gears/commands.py
Expand Up @@ -52,6 +52,16 @@ def create(cls):
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", cls.NAME)
cls.GEAR_FUNCTION(obj)
ViewProviderGear(obj.ViewObject)

# borrowed from threaded profiles
# puts the gear into an active container
body = Gui.ActiveDocument.ActiveView.getActiveObject("pdbody")
part = Gui.ActiveDocument.ActiveView.getActiveObject("part")

if body:
body.Group += [obj]
elif part:
part.Group += [obj]
return obj

def GetResources(self):
Expand Down

0 comments on commit 0a19329

Please sign in to comment.