open_file.FlatScript 1.2 KB

1234567891011121314151617181920212223242526
  1. # #####################################################################################
  2. # DESCRIPTION:
  3. # Will open a Gerber (and Excellon) file in FlatCAM
  4. # #####################################################################################
  5. puts "**************** RUNNING an EXAMPLE SCRIPT = Open a file *******************"
  6. # ----------- START: This is needed only for the examples ----------------
  7. # first set the default location where to search for the files to be open and store it to the ROOT_FOLDER variable
  8. set ROOT_FOLDER [get_sys root_folder_path]
  9. # calculate the resources path for the examples we need to run and store it inside the PATH varaible
  10. set PATH ${ROOT_FOLDER}/assets/examples/files
  11. # ----------- END: This is needed only for the examples ----------------
  12. # set the working path to the path that holds the files we are going to work with
  13. set_path $PATH
  14. # load the GERBER file and rename it to a known name so we can use it further
  15. open_gerber test.gbr -outname gerber_obj
  16. # load the Excellon file and rename it to a known name so we can use it further
  17. open_excellon test.txt -outname excellon_obj
  18. # plot them all so we can see them on canvas
  19. plot_all