Support for user tools/scripts

Issue #258 new
Felipe Stival created an issue

I wish that I could create some tools to help me without having to create a fork. I've been using FlatCAM for some time and I have to do some repetitive tasks that can be automated pretty easily, and I don't think they're important enough to be on the "tool" section.

Comments (9)

  1. Marius Stanciu

    @v0idpwn I've added support for loading and running TCL scripts in GUI in my last commit on my FlatCAM fork. Test it and I may make a pull request for it here.

  2. Brian

    I am interested in FULLY automating FlatCAM by the use of scripts, as there are so many options for each process and so many processes that need to be done for each board.

    Are there any good example scripts (.tcl files) around that I can modify, as I cannot find any?

    Many Thanks

  3. Marius Stanciu

    Hi Brian,

    Have a look at Kamil’s work (he’s the one that made a very large contribution regarding the TclCommands) for an example:

    https://bitbucket.org/sopak/flatcam/wiki/Home

    But if you want to use FlatCAM beta, there may be changes in the script because the TclCommands may have changed in the meantime (or not working, as it was never a priority for me).

  4. Brian

    Hi Marius,

    Many thanks for the info, I completely missed that… not even google knows it is there!!

    I am not sure this is the correct place to put this query, please let me know if there is a place.

    The last commit cc7e758 seems to have broken the command ‘ncc’

    ERROR: clear_copper() got an unexpected keyword argument 'tooldia'

    Python traceback: <class 'TypeError'>

    File "C:TempWinpython32-3.7.4.0FlatCAMFlatCAM-Beta-cc7e758cda89 clCommandsTclCommandCopperClear.py", line 228, in execute > tools_storage=ncc_tools)

    File "C:TempWinpython32-3.7.4.0FlatCAMFlatCAM-Beta-cc7e758cda89 clCommandsTclCommand.py", line 282, in execute_wrapper > return self.execute(args, unnamed_args)

    while executing

    "ncc ${LAYER_NAME}_tracks -tooldia ${LASER_DIAMETER} -overlap ${LASER_ISOLATION_OVERLAP} -method ${LASER_NCC_METHOD} -connect ${LASER_NCC_CONNECT} -con..."

    (procedure "do_layer" line 34)

    invoked from within

    "do_layer Top"

    Although commit 2907a73 this works fine.

  5. Marius Stanciu

    Hi Brian,

    Yes I know, I’ve changed the parameter name from tooldia to ncctooldia and forgot to update it in the ncc TclCommand. It’s already fixed and I’m ready for a new build but I’ve broken the translations by changing the app strings to make them more friendly for future translations and I’m waiting for the guys that can fix the Portuguese and Russian. I also need to update the Spanish (google translate) so it will take a bit more time.

  6. Brian

    Ok thanks for the update.

    Also millholesproduces an error in both commit 2907a73 and cc7e758

    ERROR: Operation failed: 'FlatCAMExcellon' object has no attribute 'generate_milling'

    while executing

    "millholes Top_drills "

  7. Log in to comment