Set working plane immediately upon clicking the set working plane button if you have a face selected
This commit is contained in:
committed by
Yorik van Havre
parent
d05feb2f45
commit
2f14667cea
@@ -311,16 +311,16 @@ class SelectPlane(DraftTool):
|
||||
def Activated(self):
|
||||
DraftTool.Activated(self)
|
||||
self.offset = 0
|
||||
if self.doc:
|
||||
|
||||
self.ui.selectPlaneUi()
|
||||
FreeCAD.Console.PrintMessage(translate("draft", "Pick a face to define the drawing plane")+"\n")
|
||||
if plane.alignToSelection(self.offset):
|
||||
FreeCADGui.Selection.clearSelection()
|
||||
self.display(plane.axis)
|
||||
self.finish()
|
||||
else:
|
||||
self.call = self.view.addEventCallback("SoEvent", self.action)
|
||||
if not self.doc:
|
||||
return
|
||||
self.ui.selectPlaneUi()
|
||||
FreeCAD.Console.PrintMessage(translate("draft", "Pick a face to define the drawing plane")+"\n")
|
||||
if plane.alignToSelection(self.offset):
|
||||
FreeCADGui.Selection.clearSelection()
|
||||
self.display(plane.axis)
|
||||
self.finish()
|
||||
else:
|
||||
self.call = self.view.addEventCallback("SoEvent", self.action)
|
||||
|
||||
def action(self, arg):
|
||||
if arg["Type"] == "SoKeyboardEvent" and arg["Key"] == "ESCAPE":
|
||||
|
||||
@@ -269,7 +269,8 @@ class plane:
|
||||
if len(sex) == 0:
|
||||
return False
|
||||
elif len(sex) == 1:
|
||||
if not sex[0].Object.isDerivedFrom("Part::Shape"):
|
||||
if not sex[0].Object.isDerivedFrom("Part::Feature") \
|
||||
or not sex[0].Object.Shape:
|
||||
return False
|
||||
return self.alignToCurve(sex[0].Object.Shape, offset) \
|
||||
or self.alignToFace(sex[0].Object.Shape, offset) \
|
||||
|
||||
Reference in New Issue
Block a user