1
0
Fork 0
This repository has been archived on 2019-12-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
arduinisten/eagle-5.7.0/ulp/ex-run-script.ulp

33 lines
835 B
Text
Raw Normal View History

2010-03-30 20:14:34 +02:00
#usage "<b>Example: Export a script and execute it</b>\n"
"<p>"
"<author>Author: support@cadsoft.de</author>"
// THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED
string cmd = "";
string dev = "";
cmd += "OPEN TEST.LBR;\n";
cmd += "Edit testxx.pac;\n";
cmd += "change Layer tPlace;\n";
cmd += "Grid MIL ON;\n";
cmd += "; WIRE 1 (-100 -100) (230 360);\n";
cmd += "; WIRE 20 (-10 -50) (130 60);\n";
cmd += "WIN FIT;\n;";
string ulp_path;
// ** always use '/' as path delimiter to keep ULPs platform independent **
char bkslash = '/';
int pos = strrchr(argv[0], bkslash);
if (pos >= 0) { // split path from filename
ulp_path = strsub(argv[0], 0, pos + 1);
}
output(ulp_path + "v4test.scr", "wt") {
printf(cmd);
}
exit("; SCR '" + ulp_path + "v4test.scr';\n");