cncjob tools_drill_toolchange exception - fixed for next version

Issue #562 new
nerdunio created an issue

Hi

I am trying to generate gcode from the copper layer with the help of the following flatscript.

open_gerber "detector_copper_bottom.gbr" -outname gerber_copper
isolate gerber_copper -dia 0.1 -passes 2 -overlap 10  -outname gerber_iso
cncjob gerber_iso -dia 0.1 -z_cut -0.04 -z_move 2 -feedrate 120
plot_all

Im on Beta_8.995 commit b003b95.

And I get this console output.

[SUCCESS] Opened: detector_copper_bottom.gbr
DEBUG 20220127_190002 ***   TCL command 'TclCommandIsolate' executed.
DEBUG 20220127_190002 ***   AppObject.new_object()
DEBUG 20220127_190002 ***   Calling object constructor...
DEBUG 20220127_190002 ***   0.020005 seconds before initialize().
DEBUG 20220127_190003 ***   New object with name: gerber_iso. 0.662158 seconds executing initialize().
New object with name: gerber_iso. 0.662158 seconds executing initialize().
DEBUG 20220127_190003 ***   camlib.Geometry.bounds()
DEBUG 20220127_190003 ***   Moving new object back to main thread.
DEBUG 20220127_190003 ***   on_object_created()
DEBUG 20220127_190003 ***   on_object_created --> OC.append()
DEBUG 20220127_190003 ***   GeometryObject.set_ui()
DEBUG 20220127_190003 ***   camlib.Geometry.bounds()
DEBUG 20220127_190003 ***   TCL command 'TclCommandCncjob' executed.
DEBUG 20220127_190003 ***   ToolMilling.mtool_gen_cncjob()
DEBUG 20220127_190003 ***   AppObject.new_object()
DEBUG 20220127_190003 ***   Calling object constructor...
DEBUG 20220127_190003 ***   Creating CNCJob object...
DEBUG 20220127_190003 ***   0.089934 seconds before initialize().
DEBUG 20220127_190003 ***   Creating a CNCJob out of a multi-geometry
Indexing geometry before generating G-Code...
DEBUG 20220127_190003 ***   Starting G-Code for tool with diameter: 0.1MM.
Starting G-Code for tool with diameter: 0.1MM.
DEBUG 20220127_190003 ***   camlib.CNCJob.geometry_tool_gcode_gen() -> Multidepth OFF -> Single Pass
Finished G-Code generation... 40 paths traced.
[SUCCESS] G-Code parsing in progress...
[ERROR] An internal error has occurred. See shell.
Object (cncjob) failed because: 'tools_drill_toolchange' 
Traceback (most recent call last):
  File "C:\desktop\flatcam_beta\appObjects\AppObject.py", line 168, in new_object
    return_value = initialize(obj, self.app)
  File "C:\desktop\flatcam_beta\appPlugins\ToolMilling.py", line 3460, in job_init_multi_geometry
    dia_cnc_dict['gcode_parsed'] = new_cncjob_obj.gcode_parse(tool_data=tools_dict[tooluid_key]['data'])
  File "C:\desktop\flatcam_beta\camlib.py", line 6578, in gcode_parse
    if tool_data["tools_drill_toolchange"] is True:
KeyError: 'tools_drill_toolchange'
DEBUG 20220127_190004 ***   TCL command 'TclCommandPlotAll' executed.
DEBUG 20220127_190004 ***   Plot_all()