Message 1 of 10
Put all Xrefs on a locked layer "C-XREF"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
I'd like for the following lisp to include a layer lock function.
Currently, the lisp creates the layer C-XREF and puts all xrefs in the drawing in that layer. I would like it to also lock the C-XREF layer. Thanks in advance.
(defun c:xrlayer ( / a b c d layer )
(setq layer "C-XREF")
(while (setq a (tblnext "BLOCK" (null a)))
(if (= 4 (logand 4 (cdr (assoc 70 a))))
(setq b (cons "," (cons (cdr (assoc 2 a)) b)))
)
)
(if (setq c
(ssget "_X"
(list
(cons 0 "INSERT")
(cons 2 (apply 'strcat (cdr b)))
(cons 8 (strcat "~" layer))
)
)
)
(repeat (setq d (sslength c))
(entmod (list (cons -1 (ssname c (setq d (1- d)))) (cons 8 layer)))
)
)
(princ)
(command "_.layer"
"_color" 6 "C-XREF"
""
)
(princ)
)