drillcncjob "KeyError:" when running from shell

Issue #277 resolved
Krzysztof Kluczek created an issue

Running "drillcncjob" from shell produces the following error:

[ERROR_NOTCL] An internal error has ocurred. See shell.
Object (cncjob) failed because: 0.76 

Traceback (most recent call last):
  File "D:\1.DEV\FlatCAM_beta\FlatCAMApp.py", line 2476, in new_object
  File "D:\1.DEV\FlatCAM_beta\tclCommands\TclCommandDrillcncjob.py", line 107, in job_init
  File "D:\1.DEV\FlatCAM_beta\camlib.py", line 5225, in generate_from_excellon_by_tool
KeyError: 0.76

The log comes from the version installed vis FlatCAM_beta_8.911_x86_installer.exe, but it also happens on x86 8.909 beta version.

The issue did NOT happen in FlatCam 8.5 - the attached script/drill files did work as intended and the problem only surfaced after the upgrade.

I'm using FlatCam set to metric units, but it doesn't affect the outcome (checked). The other preferences are fresh from the install. I assume the drill file is correct, because there's no problem when generating the CNC file manually from the GUI. The arguments passed to 'drillcncjob' command also doesn't seem to affect the outcome.

The files causing this behavior are attached - make sure to change absolute paths in the BAT and shell files before running.

Thanks, KK

Comments (11)

  1. Marius Stanciu

    Hi @KK_DMA,

    Thanks for the report! I fixed it and it will be published soon in Beta 8.912.

    The reason behind this error is that I don't use the scripting feature. Therefore I don't focus my efforts in updating the Tcl commands although changes I make may brake something in the usage of Tcl Commands.

    I rely on users to report those errors. It's a sort of contribution that users can do.

  2. Krzysztof Kluczek reporter

    Thanks a lot!

    I, on the other hand, use scripting almost exclusively to completely automate (and fool-proof) the process of PCB milling, drilling and cutting out. I'll make sure to keep you posted if I ever spot any problems in this area.

    Thanks, KK

  3. Krzysztof Kluczek reporter

    Did you run the script from the command line when launching the application, as in the BAT file in the original attached ZIP? (EDIT: it doesn't matter - just tried running the script from the menu, and it failed as well)

    Just to verify, I tried again: - performed a full uninstall of the current version, - installed the FlatCAM_beta_8.912_x86_installer.exe into a new folder, - ran the program using the attached BAT file (after setting paths in the .bat and .fscript files)

    The program failed with similar error report. http://devkk.net/webimg/FlatCam-issue.png

    The value after the "KeyError:" is different because I didn't even switch preferences to MM to make sure I've got a fresh install, and it looks like the line numbers changed, understandably. I'm using Windows 10 x64, in case that matters.

    The problem seems to go away after removing that version and installing the x64 version. I also have no idea why this should affect the result, but looks like it does. But if you think it's an acceptable behavior, the bug can be closed.

    Thanks, KK

  4. Marius Stanciu

    I will look into it, I have not tested the x86 installer since it's creation is merely an installer script parameter change ...

    BTW, since you mess with the BAT files I decided it to 'save' you from them :) In the next build you'll have the ability to double click on a FlatCAM script file (it needs the file extension to be .FlatScript) and FlatCAM will run the script. Therefore the BAT is obsolete.

    I also have added the ability to open a script in FlatCAM so you can edit it (just a convenience, otherwise the good - old Notepad can do the job as well) and also to create a new script file within FlatCAM and then save it as a file.

    In the TODO is to add a Tcl command to save the gcode (it will be saved next to the last opened file or to a specified path).

    Hopefully those will be of help for those in your situation, who are using the TCL scripting.

  5. Marius Stanciu

    Hi @KK_DMA ,

    I have verified and indeed there is a problem with the x86 installer. Thank you for reporting this. I think that I may have made a mistake (I made the installer's late in the night so I was tired) and perhaps did not deleted the old installer files and when freezing the new build, if it saw that there is a file it did not replace it. That's all I can think of as a possible cause of the issue since the issue is solved in the sources and it works for the x64 installer.

    Next build will have this issue fixed for the x86 installer.

  6. Krzysztof Kluczek reporter

    Hi!

    The Bat file is just an example for reproduction. I launch FlatCAM with that command line directly from my custom C++ program, which generates the script based on the available files and descriptions (available Gerber layers, custom drill size remapping, etc), runs the tool, waits until it's closed and processes the output files further (e.g. preparing info about the board size or making extra GCode file to break the gaps in the board cutout). This way I can design a board and with one click have everything prepared for CNC milling in a fool-proof and perfectly reproducible way. So thanks, but I have everything automated around the FlatCAM here. :)

    As for the installers - is it correct that x64 installer is nearly twice the size of the x86 one?

    Thanks, KK

  7. Marius Stanciu
    As for the installers - is it correct that x64 installer is nearly twice the size of the x86 one?
    

    About so, more like 1.5 times. As a difference compared with the 32bit version, the 64bit version include the Google OR Tools which is a big package used for a more efficient drills toolpath optimization. The rest is due of the 64bit variant of the used packages. Perhaps the packages can be 'cleaned up' more but I have not dedicated the time for that except on the PyQt5 package. Maybe the OpenGL package can be trimmed down, too, but this takes a lot of 'try and see'.

  8. Marius Stanciu

    @KK_DMA , You were right. In the previous fix I missed some things. They are solved now, you can try the fix in the new version 8.913. I will close this now.

  9. Log in to comment