From cb06794e76c79f80e7e3dee4d469f7f221ac1cf9 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sat, 2 Sep 2017 15:15:15 -0700 Subject: [PATCH] Removed obsolete path stock command and view provider. --- src/Mod/Path/InitGui.py | 3 +- src/Mod/Path/PathScripts/PathStock.py | 60 --------------------------- 2 files changed, 1 insertion(+), 62 deletions(-) diff --git a/src/Mod/Path/InitGui.py b/src/Mod/Path/InitGui.py index b237e6a025..016e52977a 100644 --- a/src/Mod/Path/InitGui.py +++ b/src/Mod/Path/InitGui.py @@ -68,7 +68,6 @@ class PathWorkbench (Workbench): from PathScripts import PathProfileFacesGui from PathScripts import PathSanity from PathScripts import PathSimpleCopy - from PathScripts import PathStock from PathScripts import PathStop from PathScripts import PathSurface from PathScripts import PathToolController @@ -84,7 +83,7 @@ class PathWorkbench (Workbench): threedopcmdlist = ["Path_Surfacing"] modcmdlist = ["Path_OperationCopy", "Path_Array", "Path_SimpleCopy" ] dressupcmdlist = ["PathDressup_Dogbone", "PathDressup_DragKnife", "PathDressup_Tag", "PathDressup_RampEntry"] - extracmdlist = ["Path_SelectLoop", "Path_Shape", "Path_Area", "Path_Area_Workplane", "Path_Stock"] + extracmdlist = ["Path_SelectLoop", "Path_Shape", "Path_Area", "Path_Area_Workplane"] #modcmdmore = ["Path_Hop",] #remotecmdlist = ["Path_Remote"] diff --git a/src/Mod/Path/PathScripts/PathStock.py b/src/Mod/Path/PathScripts/PathStock.py index 9dbb46c6fc..3ea5f827c7 100644 --- a/src/Mod/Path/PathScripts/PathStock.py +++ b/src/Mod/Path/PathScripts/PathStock.py @@ -23,7 +23,6 @@ '''used to create material stock around a machined part- for visualization ''' import FreeCAD -import FreeCADGui import Part import PathIconViewProvider @@ -128,63 +127,4 @@ def CreateCylinder(job, radius=None, height=None, at=None): SetupStockObject(obj, False) return obj - -class _ViewProviderStock: - - def __init__(self, obj): # mandatory - # obj.addProperty("App::PropertyFloat","SomePropertyName","PropertyGroup","Description of this property") - obj.Proxy = self - - def __getstate__(self): # mandatory - return None - - def __setstate__(self, state): # mandatory - return None - - def getIcon(self): # optional - return ":/icons/Path-Stock.svg" - - def attach(self, vobj): # optional - self.Object = vobj.Object - - -class CommandPathStock: - - def GetResources(self): - return {'Pixmap': 'Path-Stock', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("PathStock", "Stock"), - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("PathStock", "Creates a 3D object to represent raw stock to mill the part out of")} - - def IsActive(self): - return FreeCAD.ActiveDocument is not None - - def Activated(self): - FreeCAD.ActiveDocument.openTransaction(translate("Path_Stock", "Creates a 3D object to represent raw stock to mill the part out of")) - FreeCADGui.addModule("PathScripts.PathStock") - snippet = ''' -import FreeCADGui -if len(FreeCADGui.Selection.getSelection())>0: - sel=FreeCADGui.Selection.getSelection() - o = sel[0] - if "Shape" in o.PropertiesList: - obj =FreeCAD.ActiveDocument.addObject('Part::FeaturePython',sel[0].Name+('_Stock')) - PathScripts.PathStock.Stock(obj) - PathScripts.PathStock._ViewProviderStock(obj.ViewObject) - PathScripts.PathUtils.addToJob(obj) - baseobj = sel[0] - obj.Base = baseobj - FreeCADGui.ActiveDocument.getObject(sel[0].Name+("_Stock")).ShapeColor = (0.3333,0.6667,1.0000) - FreeCADGui.ActiveDocument.getObject(sel[0].Name+("_Stock")).Transparency = 75 - FreeCAD.ActiveDocument.recompute() - else: - FreeCAD.Console.PrintMessage("Select a Solid object and try again.\\n") -else: - FreeCAD.Console.PrintMessage("Select the object you want to show stock for and try again.\\n") - ''' - FreeCADGui.doCommand(snippet) - -if FreeCAD.GuiUp: - # register the FreeCAD command - FreeCADGui.addCommand('Path_Stock', CommandPathStock()) - FreeCAD.Console.PrintLog("Loading PathStock... done\n")