- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thanks for making this Lisp, I'm using it well.
I would like to add one thing. When using this Lisp, try to exclude the layer being frozen.
therefore
Except for objects whose layers are frozen, I want only non-frozen objects to run with this Lisp.
thanks for reading
some help... experts...
(defun c:lcc (/ SetLayer obj acdoc blocks)
(vl-load-com)
(defun SetLayer (blockName layerName)
(vlax-for obj (vla-Item blocks blockName)
(vla-put-Layer obj layerName)
(if (= (vla-get-ObjectName obj) "AcDbBlockReference")
(SetLayer (vla-get-Name obj) layerName)
)
)
)
(if (and (setq obj (car (entsel "\nmake layer name same")))
(setq obj (vlax-ename->vla-object obj))
(= (vla-get-ObjectName obj) "AcDbBlockReference")
)
(progn
(setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object))
blocks (vla-get-Blocks acdoc)
)
(SetLayer (vla-get-Name obj) (vla-get-Layer obj))
(vla-Regen acdoc acActiveViewport)
)
)
(princ)
)
Solved! Go to Solution.