File: ex-run-script.ulp

package info (click to toggle)
eagle 4.16-5
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 36,508 kB
  • sloc: sh: 82; makefile: 32
file content (32 lines) | stat: -rw-r--r-- 835 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#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");