From 4262544bbf1b61d3762963a7e1c25101f878f9bc Mon Sep 17 00:00:00 2001 From: sliptonic Date: Sat, 17 Dec 2016 16:46:17 -0600 Subject: [PATCH] PATH: fix for drilling border case If only single hole of a given size is found, it was ignored. Doh! --- src/Mod/Path/InitGui.py | 2 +- src/Mod/Path/PathScripts/PathDrilling.py | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/InitGui.py b/src/Mod/Path/InitGui.py index bee382340..7e2959903 100644 --- a/src/Mod/Path/InitGui.py +++ b/src/Mod/Path/InitGui.py @@ -134,7 +134,7 @@ class PathWorkbench (Workbench): if len(FreeCADGui.Selection.getSelection()) == 1: if FreeCADGui.Selection.getSelection()[0].isDerivedFrom("Path::Feature"): self.appendContextMenu("", ["Path_Inspect"]) - if "Profile" or "Contour" in FreeCADGui.Selection.getSelection()[0].Name: + if FreeCADGui.Selection.getSelection()[0].Name in ["Profile", "Contour"]: self.appendContextMenu("", ["Add_Tag"]) self.appendContextMenu("", ["Set_StartPoint"]) self.appendContextMenu("", ["Set_EndPoint"]) diff --git a/src/Mod/Path/PathScripts/PathDrilling.py b/src/Mod/Path/PathScripts/PathDrilling.py index ccdec749b..2cd9b79e8 100644 --- a/src/Mod/Path/PathScripts/PathDrilling.py +++ b/src/Mod/Path/PathScripts/PathDrilling.py @@ -266,6 +266,12 @@ class ObjectDrilling: FreeCAD.Console.PrintWarning("Drillable location already in the list" + "\n") else: baselist.append(item) + else: + if item in baselist: + FreeCAD.Console.PrintWarning("Drillable location already in the list" + "\n") + else: + baselist.append(item) + if sub[0:4] == 'Edge': drillableEdges = [] @@ -277,7 +283,7 @@ class ObjectDrilling: if candidateedge.Curve.Radius == o.Curve.Radius and candidateedge.Curve.Center.z == o.Curve.Center.z: drillableEdges.append("Edge" + str(i+1)) if len(drillableEdges) > 1: - reply = QtGui.QMessageBox.question(None,"","Multiple drillable faces found. Drill them all?", + reply = QtGui.QMessageBox.question(None,"","Multiple drillable edges found. Drill them all?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.No) if reply == QtGui.QMessageBox.Yes: for i in drillableEdges: @@ -292,6 +298,11 @@ class ObjectDrilling: FreeCAD.Console.PrintWarning("Drillable location already in the list" + "\n") else: baselist.append(item) + else: + if item in baselist: + FreeCAD.Console.PrintWarning("Drillable location already in the list" + "\n") + else: + baselist.append(item) print baselist obj.Base = baselist