-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLayerSelect.lsp
More file actions
30 lines (29 loc) · 1.11 KB
/
LayerSelect.lsp
File metadata and controls
30 lines (29 loc) · 1.11 KB
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
;; LayerSelect --> Jonathan Handojo
;; Allows the user to select all object inside a layer simply by selecting one of them.
;; Invoke the command by typing LAYSEL
(defun c:laysel ( / esclay lay obj)
(if (setq obj (entsel "\nSelect an object where all objects in that layer will be selected: "))
(progn
(setq
lay (cdr (assoc 8 (entget (car obj))))
esclay
(vl-list->string
(apply 'append
(mapcar
'(lambda (x)
(if
(vl-position x '(35 64 46 42 63 126 91 93 45 44))
(list 96 x)
(list x)
)
)
(vl-string->list lay)
)
)
)
)
(sssetfirst nil (ssget "_X" (list (cons 8 esclay) (cons 410 (getvar 'ctab)))))
)
)
(princ)
)