-
Notifications
You must be signed in to change notification settings - Fork 24
/
sldv.il
81 lines (67 loc) · 2.01 KB
/
sldv.il
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
axlCmdRegister("sldv", 'sldv, ?cmdType "general")
defun(sldv ()
let((g_err ll_winBox lo_sld lo_via g_bot g_top s_file p_rpt)
g_err = nil
axlVisibleDesign(nil)
axlVisibleLayer("BOARD GEOMETRY/SOLDERMASK_TOP" t)
axlVisibleLayer("BOARD GEOMETRY/SOLDERMASK_BOTTOM" t)
axlVisibleLayer("PACKAGE GEOMETRY/SOLDERMASK_TOP" t)
axlVisibleLayer("PACKAGE GEOMETRY/SOLDERMASK_BOTTOM" t)
axlVisibleLayer("PIN/SOLDERMASK_TOP" t)
axlVisibleLayer("PIN/SOLDERMASK_BOTTOM" t)
axlVisibleLayer("VIA CLASS" t)
ll_winBox = axlWindowBoxGet()
axlWindowBoxSet(list(0:0 5:5))
axlSetFindFilter(?enabled '("noall" "vias") ?onButtons '("noall" "vias"))
axlClearSelSet()
axlAddSelectAll()
lo_via = axlGetSelSet()
axlClearSelSet()
axlSetFindFilter(
?enabled '("noall" "pins" "shapes" "lines")
?onButtons '("noall" "pins" "shapes" "lines")
)
s_file = axlTempFile()
p_rpt = outfile(s_file)
foreach(i lo_via
axlAddSelectBox(sldv_iRec(i->xy i->bBox))
lo_sld = axlGetSelSet()
axlClearSelSet()
when(length(lo_sld) > 1
g_top = nil
g_bot = nil
foreach(j lo_sld
;deal with pins and other obj repsectively
if(j->objType == "pin"
then
if(j->isMirrored g_bot = t g_top = t)
else
when(rexMatchp("TOP$" j->layer) g_top = t)
when(rexMatchp("BOTTOM$" j->layer) g_bot = t)
);if pin
);foreach sld obj
when(g_top && g_bot
fprintf(p_rpt, "via @ %L\n", i->xy)
axlHighlightObject(i)
g_err = t
);when sld at top&bot
);when sld obj>1
);foreach via
unless(g_err fprintf(p_rpt, "No errors found.\n"))
close(p_rpt)
axlUIWExpose(axlUIViewFileCreate(s_file "Check Report" nil))
axlTempFileRemove(s_file)
axlWindowBoxSet(ll_winBox)
);let
)
;work out the inner square of a via(circle)
defun(sldv_iRec (f_xy l_bBox)
prog((f_x f_y f_r f_delta)
f_x = car(f_xy)
f_y = cadr(f_xy)
f_r = (caadr(l_bBox)-caar(l_bBox)) * 0.5
f_delta = f_r / 1.41
return(list(list(f_x-f_delta f_y+f_delta) list(f_x+f_delta f_y-f_delta)))
)
)
;END