Skip to content

Commit

Permalink
Make gear creation "undoable"
Browse files Browse the repository at this point in the history
Right now, the tool tip is used as transaction name, which matches the
wording "Create a new sketch". There doesn't seem to be consistency
though FreeCAD's other workbenches, though.
  • Loading branch information
jbaehr authored and looooo committed Oct 22, 2021
1 parent 69ff30d commit 6ce203e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion freecad/gears/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ def IsActive(self):
return True

def Activated(self):
doc = FreeCAD.ActiveDocument
Gui.doCommandGui("import freecad.gears.commands")
doc.openTransaction(self.ToolTip)
Gui.doCommandGui("freecad.gears.commands.{}.create()".format(
self.__class__.__name__))
FreeCAD.ActiveDocument.recompute()
doc.commitTransaction()
doc.recompute()
Gui.SendMsgToActiveView("ViewFit")

@classmethod
Expand Down

0 comments on commit 6ce203e

Please sign in to comment.