Skip to content

Commit

Permalink
fix double object creation in base shape. Issue #386
Browse files Browse the repository at this point in the history
  • Loading branch information
shaise committed Oct 20, 2024
1 parent 737aa4d commit 2f63bb8
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions SheetMetalBaseShapeCmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,18 +461,10 @@ def GetResources(self):

def Activated(self):
doc = FreeCAD.ActiveDocument
activeBody = None
view = Gui.ActiveDocument.ActiveView
if hasattr(view, "getActiveObject"):
activeBody = view.getActiveObject("pdbody")
doc.openTransaction("BaseShape")
a = doc.addObject("PartDesign::FeaturePython","BaseShape")
SMBaseShape(a)
SMBaseShapeViewProviderFlat(a.ViewObject)
if not activeBody:
activeBody = FreeCAD.activeDocument().addObject('PartDesign::Body','Body')
Gui.ActiveDocument.ActiveView.setActiveObject('pdbody', activeBody)
activeBody.addObject(a)
doc.recompute()

dialog = BaseShapeTaskPanel(a)
Expand Down

0 comments on commit 2f63bb8

Please sign in to comment.