Added support for align move to origin.

This commit is contained in:
Markus Lampert
2017-09-08 12:25:58 +02:00
committed by wmayer
parent ba0b5e5481
commit f73a63eee3
+14 -1
View File
@@ -436,8 +436,21 @@ class TaskPanel:
def alignSetOrigin(self):
pass
def alignMoveToOrigin(self):
pass
selObject = None
selFeature = None
for sel in FreeCADGui.Selection.getSelectionEx():
selObject = sel.Object
for feature in sel.SubElementNames:
selFeature = feature
sub = sel.Object.Shape.getElement(feature)
if 'Vertex' == sub.ShapeType:
p = sub.Point
Draft.move(sel.Object, FreeCAD.Vector() - p)
if selObject and selFeature:
FreeCADGui.Selection.clearSelection()
FreeCADGui.Selection.addSelection(selObject, selFeature)
def updateSelection(self):
sel = FreeCADGui.Selection.getSelectionEx()