Update gui_ellipses.py

Gui.addModule("Draft") should be executed before committing _cmd_list irrespective of the UsePartPrimitives setting.
This commit is contained in:
Roy-043
2021-04-29 21:03:44 +02:00
committed by GitHub
parent e2e380655b
commit 16cfcf51c3

View File

@@ -104,9 +104,9 @@ class Ellipse(gui_base_original.Creator):
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 @@ class Ellipse(gui_base_original.Creator):
_cmd_list)
else:
# Insert a Draft ellipse
Gui.addModule("Draft")
_cmd = 'Draft.makeEllipse'
_cmd += '('
_cmd += str(r1) + ', ' + str(r2) + ', '