Use same ToolNumber if TC is for identical Tool as another TC in the same job.

This commit is contained in:
Markus Lampert
2019-10-24 20:03:51 -07:00
parent 159a6350f3
commit f7dc3f65b9

View File

@@ -156,7 +156,13 @@ class CommandPathToolController(object):
if job:
tool = PathToolBitGui.ToolBitSelector().getTool()
if tool:
toolNr = max([tc.ToolNumber for tc in job.ToolController]) + 1
toolNr = None
for tc in job.ToolController:
if tc.Tool == tool:
toolNr = tc.ToolNumber
break
if not toolNr:
toolNr = max([tc.ToolNumber for tc in job.ToolController]) + 1
tc = Create("TC: {}".format(tool.Label), tool, toolNr)
job.Proxy.addToolController(tc)
FreeCAD.ActiveDocument.recompute()