Draft: move Draft_FlipDimension to gui_dimension_ops module

This commit is contained in:
vocx-fc
2020-03-16 21:38:14 -06:00
committed by Yorik van Havre
parent 28e2e20a00
commit 91c75b03f7
4 changed files with 85 additions and 15 deletions

View File

@@ -87,6 +87,7 @@ from draftguitools.gui_groups import AddToGroup
from draftguitools.gui_groups import SelectGroup
from draftguitools.gui_grid import ToggleGrid
from draftguitools.gui_heal import Heal
from draftguitools.gui_dimension_ops import Draft_FlipDimension
# import DraftFillet
import drafttaskpanels.task_shapestring as task_shapestring
import drafttaskpanels.task_scale as task_scale
@@ -4739,20 +4740,6 @@ class Draft_Facebinder(Creator):
FreeCAD.ActiveDocument.recompute()
self.finish()
class Draft_FlipDimension():
def GetResources(self):
return {'Pixmap' : 'Draft_FlipDimension',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_FlipDimension", "Flip Dimension"),
'ToolTip' : QtCore.QT_TRANSLATE_NOOP("Draft_FlipDimension", "Flip the normal direction of a dimension")}
def Activated(self):
for o in FreeCADGui.Selection.getSelection():
if Draft.getType(o) in ["Dimension","AngularDimension"]:
FreeCAD.ActiveDocument.openTransaction("Flip dimension")
FreeCADGui.doCommand("FreeCAD.ActiveDocument."+o.Name+".Normal = FreeCAD.ActiveDocument."+o.Name+".Normal.negative()")
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()
class Mirror(Modifier):
"""The Draft_Mirror FreeCAD command definition"""
@@ -5302,7 +5289,6 @@ FreeCADGui.addCommand('Draft_Stretch',Stretch())
# context commands
FreeCADGui.addCommand('Draft_ApplyStyle',ApplyStyle())
FreeCADGui.addCommand('Draft_Shape2DView',Shape2DView())
FreeCADGui.addCommand('Draft_FlipDimension',Draft_FlipDimension())
FreeCADGui.addCommand('Draft_AutoGroup',SetAutoGroup())
FreeCADGui.addCommand('Draft_AddConstruction',Draft_AddConstruction())