-
Notifications
You must be signed in to change notification settings - Fork 0
/
SBC-Select-by-Color.lsp
36 lines (35 loc) · 1.12 KB
/
SBC-Select-by-Color.lsp
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
(defun c:sbc ( / c d e l )
(if (setq e (car (entsel)))
(progn
(setq c
(cond
( (cdr (assoc 62 (entget e))) )
( (abs (cdr (assoc 62 (tblsearch "LAYER" (cdr (assoc 8 (entget
e))))))) )
)
)
(while (setq d (tblnext "LAYER" (null d)))
(if (= c (abs (cdr (assoc 62 d))))
(setq l (cons "," (cons (cdr (assoc 2 d)) l)))
)
)
(sssetfirst nil
(ssget "_X"
(if l
(list
(cons -4 "<OR")
(cons 62 c)
(cons -4 "<AND")
(cons 62 256)
(cons 8 (apply 'strcat (cdr l)))
(cons -4 "AND>")
(cons -4 "OR>")
)
(list (cons 62 c))
)
)
)
)
)
(princ)
)