To acquire all blocks, I suggest that you iterate through block collection definitions and change properties of sub entities of definitions... If there are attributes - ATTDEF-s, remember you use ATTSYNC command at the end... To get blocks collection : (setq blkcoll (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))... Then iterating goes with : (vlax-for blk blkcoll ... )... When iterating through collection, you should check for xrefs : (= (vla-get-isxref blk) :vlax-false); model/paper space block : (not (wcmatch (strcase (vla-get-name blk)) "*SPACE*"))... And to get ATTDEF-s vla-objects, you should call : (setq attdefs-vla-objs (append (vlax-invoke blk 'getattributes) (vlax-invoke blk 'getconstantattributes)))... When changed properties for attributes : (vlax-for attdef attdefs-vla-objs ... ), you should iterate through block definition itself : (vlax-for obj blk ... )... Now here you don't have to look for nested blocks as you are inspecting all block definitions from main collection that contains both normal blocks, dynamic blocks, nested blocks, space blocks and xrefs structured in non-nested list manner when iterating...
[EDIT : I've created one snippet chk routine for you to inspect what I explained - I've commented out what was my mistake in first explanation...]
(defun c:blkchk nil
(vl-load-com)
(vlax-for blk (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
(cond
( (and (= (vla-get-isxref blk) :vlax-false) (wcmatch (strcase (vla-get-name blk)) "*SPACE*"))
(princ (strcat "\n" (vla-get-name blk)))
)
( (and (= (vla-get-isxref blk) :vlax-false) (not (wcmatch (strcase (vla-get-name blk)) "*SPACE*")))
;;;(setq attdefs (append (vlax-invoke blk 'getattributes) (vlax-invoke blk 'getconstantattributes)))
;;;(vlax-for attdef attdefs
;;;(princ (strcat "\n" (vla-get-objectname attdef)))
;;;)
(vlax-for obj blk
(princ (strcat "\n" (vla-get-objectname obj)))
)
)
)
)
(princ)
)
Marko Ribar, d.i.a. (graduated engineer of architecture)