Make gear creation "undoable"
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.
This commit is contained in:
@@ -41,10 +41,13 @@ class BaseCommand(object):
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user