-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGroupLayLock.lsp
More file actions
36 lines (34 loc) · 867 Bytes
/
GroupLayLock.lsp
File metadata and controls
36 lines (34 loc) · 867 Bytes
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
;; Group Layer Lock - Jonathan Handojo
;; Locks all layers within a selection set.
;; Issue the command GRLAYLCK, select objects, and the layers of every
;; object selected will be locked.
(defun c:grlaylck ( / acadobj adoc i lay lck objl ss)
(setq acadobj (vlax-get-acad-object)
adoc (vla-get-ActiveDocument acadobj)
)
(vla-StartUndoMark adoc)
(and
(eq (type (setq ss (vl-catch-all-apply 'ssget))) 'pickset)
(repeat (setq i (sslength ss))
(if
(and
(setq objl (cdr (assoc 8 (entget (ssname ss (setq i (1- i))))))
lay (tblobjname "layer" objl)
lck (cdr (assoc 70 (entget lay)))
)
(= 0 (logand 4 lck))
)
(entmod
(subst
(cons 70 (+ lck 4))
(assoc 70 (entget lay))
(entget lay)
)
)
)
)
)
(vla-Regen adoc acActiveViewport)
(vla-EndUndoMark adoc)
(princ)
)