From f73a63eee361060a040ba972e90b1a5e0226084c Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 28 Aug 2017 22:42:31 -0700 Subject: [PATCH] Added support for align move to origin. --- src/Mod/Path/PathScripts/PathJobGui.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathJobGui.py b/src/Mod/Path/PathScripts/PathJobGui.py index ad472dd2d3..cfdd0286a9 100644 --- a/src/Mod/Path/PathScripts/PathJobGui.py +++ b/src/Mod/Path/PathScripts/PathJobGui.py @@ -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()