Eagle PCB ULP Tutorial: User Language Program that lists the directory path of the Project File

Published by Fudgy McFarlen on

When you need to know the path of the project you are running the ULP within the following code snippet is useful.


string get_project_path() {
  if (board)     board(B)     return(filedir(B.name));
  if (schematic) schematic(B) return(filedir(S.name));
  if (library)   library(B)   return(filedir(L.name));
}


string Directory;
Directory = get_project_path();
dlgMessageBox(Directory, "+Yes", "No","Maybe");   


 

Categories: Eagle PCBElectronics

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *