forked from robertstarr/ulp_user
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmd-grid-step.ulp
69 lines (53 loc) · 1.39 KB
/
cmd-grid-step.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
#usage "<b>Steps the current editor grid up or down by half.</b>\n"
"<p>"
"Use the Options/Assign menu to program the keyboard to the"
"following keys:<p><p>"
"Increment the current grid by half: Ctrl+F6 ==> run cmd-grid-step 'up'<br>"
"Increment the current grid by half: Shift+F6 ==> run cmd-grid-step<p>"
"<author>Author: [email protected]</author>"
// THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED
if (schematic)
{
schematic(S)
{
real distance = S.grid.distance;
string tmp;
if (argc > 1) {
distance = distance * 2.0;
} else {
distance = distance / 2.0;
}
sprintf(tmp, "GRID %f;\n", distance);
exit(tmp);
}
}
if (board)
{
board(B)
{
real distance = B.grid.distance;
string tmp;
if (argc > 1) {
distance = distance * 2.0;
} else {
distance = distance / 2.0;
}
sprintf(tmp, "GRID %f;\n", distance);
exit(tmp);
}
}
if (library)
{
library(L)
{
real distance = L.grid.distance;
string tmp;
if (argc > 1) {
distance = distance * 2.0;
} else {
distance = distance / 2.0;
}
sprintf(tmp, "GRID %f;\n", distance);
exit(tmp);
}
}