Skip to content

Commit

Permalink
Update gui_ellipses.py
Browse files Browse the repository at this point in the history
Gui.addModule("Draft") should be executed before committing _cmd_list irrespective of the UsePartPrimitives setting.
  • Loading branch information
Roy-043 committed Apr 29, 2021
1 parent e2e3806 commit 16cfcf5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Mod/Draft/draftguitools/gui_ellipses.py
Expand Up @@ -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,
Expand All @@ -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) + ', '
Expand Down

0 comments on commit 16cfcf5

Please sign in to comment.