LISP Get entities layer list within blocks and change layer of blocks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi I need a lisp but I can't find and modify code.
I want to change block's layer to 0, but only blocks has 'layers' inside.
so I found this lisp but I cound't modify it.
It just get entities' name list.
but I need entities' layer name and count it.
and as a result distinguish changing block's layer to 0.
-------------------------- Lisp Code --------------------------
(defun getblockitems (e / o n blks blk enames)
(setq
o (vlax-ename->vla-object e) ;insert object
n (vla-get-effectivename o) ;name
blks (vla-get-blocks (vla-get-document o)) ;block collection
blk (vla-item blks n) ;block of interest
)
;;build a list with the block definitions enames
(vlax-for n blk
(setq enames (cons (vlax-vla-object->ename o) enames))
)
(reverse enames) ;return list otherwise nil
)