-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathhide-airwires.ulp
82 lines (70 loc) · 2.12 KB
/
hide-airwires.ulp
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#usage "<b>Hides a group of airwires selected via the group command.</b><p>"
"Use 'RATS *' at the command line to unhide all airwires.<p>"
"<author>http://www.bobstarr.net</author>";
//////////////////////////////////////////////////////////////////////////////
//
// ADD ATTRIBUTE
//
// Copyright (C) 2011, Robert E. Starr (http://www.bobstarr.net)
//
// REVISION HISTORY:
//
// v1.00 - 05/19/2011 Initial release
//
//////////////////////////////////////////////////////////////////////////////
//
// THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND,
// EXPRESSED OR IMPLIED. IF YOU DON'T LIKE IT, DON'T USE IT!
//
//////////////////////////////////////////////////////////////////////////////
string netname[];
string cmd;
if (board)
{
int i;
int cnt = 0;
board(B)
{
cmd = "RATS ! ";
B.signals(S)
{
if (ingroup(S))
{
S.wires(W)
{
if (W.layer == 19) /* air wires */
{
int found = 0;
// Make sure it's not already in the list, duplicate check
for (i=0; i < cnt; i++)
{
if (S.name == netname[i])
{
found = 1;
break;
}
}
if (!found)
{
cmd += "'" + S.name + "' ";
netname[cnt] = S.name;
++cnt;
}
}
}
}
}
if (!cnt)
{
dlgMessageBox("No airwires selected with group command", "OK");
exit(0);
}
//dlgMessageBox(cmd);
exit(cmd);
}
}
else
{
dlgMessageBox("Start this ULP from a Board", "OK");
exit(0);
}