From 16cfcf51c3dcd2eb2a01b3a955e21cfdc47a1114 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Thu, 29 Apr 2021 21:03:44 +0200 Subject: [PATCH 1/3] Update gui_ellipses.py Gui.addModule("Draft") should be executed before committing _cmd_list irrespective of the UsePartPrimitives setting. --- src/Mod/Draft/draftguitools/gui_ellipses.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Mod/Draft/draftguitools/gui_ellipses.py b/src/Mod/Draft/draftguitools/gui_ellipses.py index e7a8844c6a0e..2c25e23f0021 100644 --- a/src/Mod/Draft/draftguitools/gui_ellipses.py +++ b/src/Mod/Draft/draftguitools/gui_ellipses.py @@ -104,9 +104,9 @@ def createObject(self): rot2 = App.Placement(m) rot2 = rot2.Rotation rot = str((rot1.multiply(rot2)).Q) + Gui.addModule("Draft") if utils.getParam("UsePartPrimitives", False): # Insert a Part::Primitive object - Gui.addModule("Part") _cmd = 'FreeCAD.ActiveDocument.' _cmd += 'addObject("Part::Ellipse", "Ellipse")' _cmd_list = ['ellipse = ' + _cmd, @@ -122,7 +122,6 @@ def createObject(self): _cmd_list) else: # Insert a Draft ellipse - Gui.addModule("Draft") _cmd = 'Draft.makeEllipse' _cmd += '(' _cmd += str(r1) + ', ' + str(r2) + ', ' From 737f4b387dfd227f305961ef3684386785997fb5 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Thu, 29 Apr 2021 21:05:52 +0200 Subject: [PATCH 2/3] Update gui_arcs.py Gui.addModule("Draft") should be executed before committing _cmd_list irrespective of the UsePartPrimitives setting. --- src/Mod/Draft/draftguitools/gui_arcs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Draft/draftguitools/gui_arcs.py b/src/Mod/Draft/draftguitools/gui_arcs.py index 1eee4672c60f..a28f1e0c4462 100644 --- a/src/Mod/Draft/draftguitools/gui_arcs.py +++ b/src/Mod/Draft/draftguitools/gui_arcs.py @@ -301,6 +301,7 @@ def drawArc(self): try: # The command to run is built as a series of text strings # to be committed through the `draftutils.todo.ToDo` class. + Gui.addModule("Draft") if utils.getParam("UsePartPrimitives", False): # Insert a Part::Primitive object _base = DraftVecUtils.toString(self.center) @@ -318,7 +319,6 @@ def drawArc(self): _cmd_list) else: # Insert a Draft circle - Gui.addModule("Draft") _base = DraftVecUtils.toString(self.center) _cmd = 'Draft.makeCircle' _cmd += '(' From 9d8c51ccd73e3d0a87f09bb70a3558153a5e8326 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Thu, 29 Apr 2021 21:07:07 +0200 Subject: [PATCH 3/3] Update gui_points.py Gui.addModule("Draft") should be executed before committing _cmd_list irrespective of the UsePartPrimitives setting. --- src/Mod/Draft/draftguitools/gui_points.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Draft/draftguitools/gui_points.py b/src/Mod/Draft/draftguitools/gui_points.py index bb9ee3cf6165..ce95f2974e07 100644 --- a/src/Mod/Draft/draftguitools/gui_points.py +++ b/src/Mod/Draft/draftguitools/gui_points.py @@ -119,6 +119,7 @@ def click(self, event_cb=None): # The command to run is built as a series of text strings # to be committed through the `draftutils.todo.ToDo` class. commitlist = [] + Gui.addModule("Draft") if utils.getParam("UsePartPrimitives", False): # Insert a Part::Primitive object _cmd = 'FreeCAD.ActiveDocument.' @@ -133,7 +134,6 @@ def click(self, event_cb=None): _cmd_list)) else: # Insert a Draft point - Gui.addModule("Draft") _cmd = 'Draft.makePoint' _cmd += '(' _cmd += str(self.stack[0][0]) + ', '