Message 1 of 25
vlax-invoke obj 'getattributes returns textstring of *TEXT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear coders
Have some strange outcomes of my code
Want to get the textstring of the ATTRIB and the ATTDEF
If i run the code below i also get back the text string of *TEXT and i wonder why since i am filtering on attribute
If i compare the print out of the block reference with the print out of the attribute definition then i see in the first list also text strings of *TEXT
How do i make sure i only get the text strings of ATTRIB and ATTDEF??
(vlax-for blk (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)));get block collection (vlax-for obj blk (cond ( (= "AcDbBlockReference" (vla-get-objectname obj)) (if (= :vlax-true (vla-get-hasattributes obj)) (foreach att (vlax-invoke obj 'getattributes) (print (vla-get-textstring att)) ) ) ) ( (= "AcDbAttributeDefinition" (vla-get-objectname obj)) (print (vla-get-textstring obj)) ) ) ); end of vlax-for obj blk (princ) ); end of vlax-for blk
If this was of any help please kudo and/or Accept as Solution
Kind Regards
Kind Regards