Fixed ToolController creation when there are multiple jobs.
This commit is contained in:
committed by
Yorik van Havre
parent
ca8f827570
commit
abe2a15a37
@@ -545,14 +545,14 @@ class EditorPanel():
|
||||
for toolnum in tools:
|
||||
tool = self.TLM.getTool(currList, int(toolnum))
|
||||
PathLog.debug('tool: {}, toolnum: {}'.format(tool, toolnum))
|
||||
for i in FreeCAD.ActiveDocument.findObjects("Path::Feature"):
|
||||
if isinstance(i.Proxy, PathScripts.PathJob.ObjectPathJob) and i.Label == targetlist:
|
||||
for job in FreeCAD.ActiveDocument.findObjects("Path::Feature"):
|
||||
if isinstance(job.Proxy, PathScripts.PathJob.ObjectPathJob) and job.Label == targetlist:
|
||||
|
||||
label = "T{}: {}".format(toolnum, tool.Name)
|
||||
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython",label)
|
||||
PathScripts.PathToolController.ToolController(obj)
|
||||
PathScripts.PathToolController._ViewProviderToolController(obj.ViewObject)
|
||||
PathUtils.addToJob(obj, targetlist)
|
||||
PathUtils.addToJob(obj, job.Name)
|
||||
FreeCAD.activeDocument().recompute()
|
||||
obj.Tool = tool.copy()
|
||||
obj.ToolNumber = int(toolnum)
|
||||
|
||||
@@ -465,7 +465,7 @@ def addToJob(obj, jobname=None):
|
||||
if len(jobs) == 1:
|
||||
job = jobs[0]
|
||||
else:
|
||||
FreeCAD.Console.PrintError("Didn't find the job")
|
||||
PathLog.error("Didn't find job %s" % jobname)
|
||||
return None
|
||||
else:
|
||||
jobs = GetJobs()
|
||||
|
||||
Reference in New Issue
Block a user