Hi,
>> the problem is i am not getting clname. it always returns "".
Not tried, but I guess your string to verify the name of the blockdefinition within the XRef might be wrong.
If you open the database from the XRef, you have blocks with names, and as long as in that database there were no XRefs bound the name "MYXREF|BLKWITHATTRIBS" will not be valid, try "BLKWITHATTRIBS" in the "if"-line instead.
If that don't work do a
Debug.Print entname
a line before your if and you see what names are found as blockdefinitions in the XRef.
to come back to your title: this just scans the block definitions within the XRef, it does not access the BlockReferences in ModelSpace (or any other space or blockdefinition if needed)
- alfred -
------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ...
blog.ish-solutions.at ...
LinkedIn ...
CDay 2026------------------------------------------------------------------------------------
(not an Autodesk consultant)