Message 1 of 29
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear coders
Coding in Visual lisp trying to get complete list of all entities inside block using the vlax-for method
This is the code I use ( gives back all items in dwg ( model and layouts) )
Why does this code gives back all entities in the dwg instead of the entities inside the block?
I used the vla-get-blocks for active document
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Get the Blocks collection
(vlax-for blkColl (vla-get-Blocks doc)
(vlax-for blkobj blkColl
(setq ename (vlax-vla-object->ename blkobj))
(print (entget ename))
)
)
This is the list I get back now
(0 . "INSERT")
(0 . "LINE")
(0 . "LINE") <-- BLOCK ENTITY
(0 . "CIRCLE") <-- BLOCK ENTITY
(0 . "VIEWPORT")
(0 . "VIEWPORT")
(0 . "VIEWPORT")
(0 . "VIEWPORT")
(0 . "LWPOLYLINE") <-- BLOCK ENTITY
(0 . "TEXT") <-- BLOCK ENTITY
(0 . "LINE")
3 block entities and rest is in model space
If this was of any help please kudo and/or Accept as Solution
Kind Regards
Kind Regards
Solved! Go to Solution.