Enhancement: TCL delete command with "-force" option

Issue #364 resolved
Oliver created an issue

Hello,

when using the TCL command "delete", either from the TCL command line or from a script (also with --shellfile), each delete operation must be confirmed in the GUI. A dialog pops up:

"Are you sure you want to permanently delete the selected objects?"

In my scripts, I would like to delete temporarily ceated objects before saving the project.
The objects are created programmatically by the script, and so I know it is save to delete them.

It would be great to have an option for the TCL command to force a deletion without a GUI prompt, for example:

delete myfile.gbr_iso -force 1

Thanks + regards
Oliver

PS: I am actually trying to automate my processing steps for PCB creation as best as possiblem, bit I am currently running into a few problems related to the TCL commands.
I hope you don't mind if I open a few more issues related to this, according to my findings (currently I am looking into another two or so).

The FlatCAM in general is great program and I would like to thank you and all the contributors for the graet work!

My best wishes for the new year! 🎉

Comments (3)

  1. Oliver reporter

    Hi Marius,

    great, that works for me.

    The only side effect is that the global settings are saved automatically when the application is closed. But this can be solved in TCL by saving the original value:

    # save value
    set saved_global_delete_confirmation [ get_sys global_delete_confirmation ]
    
    # ... some TCL commands
    
    # restore value
    if { $saved_global_delete_confirmation } { 
      set_sys global_delete_confirmation True 
    } else { 
      set_sys global_delete_confirmation False 
    }
    

    Thanks a lot!

    kind regards

    Oliver

  2. Log in to comment