Skip to content

Commit

Permalink
Merge pull request #383 from sliptonic/bug/drilling
Browse files Browse the repository at this point in the history
PATH: fix for drilling border case
  • Loading branch information
wwmayer committed Dec 18, 2016
2 parents 5998723 + 4262544 commit 8391af9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Mod/Path/InitGui.py
Expand Up @@ -134,7 +134,7 @@ def ContextMenu(self, recipient):
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"])
Expand Down
13 changes: 12 additions & 1 deletion src/Mod/Path/PathScripts/PathDrilling.py
Expand Up @@ -266,6 +266,12 @@ def addDrillableLocation(self, obj, ss, sub=""):
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 = []
Expand All @@ -277,7 +283,7 @@ def addDrillableLocation(self, obj, ss, sub=""):
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:
Expand All @@ -292,6 +298,11 @@ def addDrillableLocation(self, obj, ss, sub=""):
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
Expand Down

0 comments on commit 8391af9

Please sign in to comment.