From a547cebcf18e94f1a37a19bdb57477a0ad7ef67b Mon Sep 17 00:00:00 2001 From: Sabin Iacob Date: Mon, 17 Apr 2017 21:04:28 +0300 Subject: [PATCH] [path] Fix AttributeError when attempting to export holding tags gcode --- src/Mod/Path/PathScripts/PathDressupHoldingTags.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py index 4b132748e7..eb6965f825 100644 --- a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py +++ b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py @@ -711,6 +711,7 @@ class ObjectDressup: def __init__(self, obj): self.obj = obj + obj.addProperty("App::PropertyLink", "ToolController", "Path", QtCore.QT_TRANSLATE_NOOP("App::Property", "The tool controller that will be used to calculate the path")) obj.addProperty("App::PropertyLink", "Base","Base", QtCore.QT_TRANSLATE_NOOP("PathDressup_HoldingTags", "The base path to modify")) obj.addProperty("App::PropertyLength", "Width", "Tag", QtCore.QT_TRANSLATE_NOOP("PathDressup_HoldingTags", "Width of tags.")) obj.addProperty("App::PropertyLength", "Height", "Tag", QtCore.QT_TRANSLATE_NOOP("PathDressup_HoldingTags", "Height of tags.")) @@ -921,7 +922,7 @@ class ObjectDressup: # self.toolRadius = 5 # else: # self.toolRadius = tool.Diameter / 2 - toolLoad = obj.Base.ToolController + toolLoad = obj.ToolController if toolLoad is None or toolLoad.ToolNumber == 0: PathLog.error(translate("No Tool Controller is selected. We need a tool to build a Path\n")) #return @@ -1432,6 +1433,7 @@ class CommandPathDressupHoldingTags: FreeCADGui.doCommand('PathScripts.PathUtils.addToJob(obj)') FreeCADGui.doCommand('Gui.ActiveDocument.getObject(obj.Base.Name).Visibility = False') FreeCADGui.doCommand('dbo.setup(obj, True)') + FreeCADGui.doCommand('obj.ToolController = PathScripts.PathUtils.findToolController(obj)') FreeCAD.ActiveDocument.commitTransaction() FreeCAD.ActiveDocument.recompute()