Draft: Ability to set working plane from PartDesign datum planes

This commit is contained in:
Yorik van Havre
2018-08-20 21:56:08 -03:00
parent 952a9a4a80
commit 83351faebc

View File

@@ -385,6 +385,11 @@ class SelectPlane(DraftTool):
self.display(plane.axis)
self.finish()
return
elif sel.SubElementNames[0] == "Plane":
plane.setFromPlacement(sel.Object.Placement,rebase=True)
self.display(plane.axis)
self.finish()
return
elif len(sel.SubElementNames) == 3:
if ("Vertex" in sel.SubElementNames[0]) \
and ("Vertex" in sel.SubElementNames[1]) \
@@ -396,6 +401,13 @@ class SelectPlane(DraftTool):
self.display(plane.axis)
self.finish()
return
elif sel.Object.isDerivedFrom("Part::Feature"):
if sel.Object.Shape:
if len(sel.Object.Shape.Faces) == 1:
plane.alignToFace(sel.Object.Shape.Faces[0], self.offset)
self.display(plane.axis)
self.finish()
return
elif sel:
subs = []
import Part