Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

AUTOCAD VBA - extacting attribute values

Status
Not open for further replies.

kcimos

Civil/Environmental
Sep 12, 2003
4
0
0
US
i'm using the following code to get attribute data:
varAttributes = BlkRefObj.GetAttributes
then using i in a loop:
tag=(varAttributes(i).TagString)
value=(varAttributes(i).TextString)

this works fine for most attributes, but there is a least 1 attribute in a title block that the .textstring property is nothing even though the attribute has a value

anyone know why this only works 99% of the time?
 
Replies continue below

Recommended for you

Are you sure it has a value, or is it just "supposed" to have a value. Did you try edit attributes, and if so, is the text actual there?
 
I THINK I FOUND THE PART OF PROBLEM:
there are ~20 layouts each with the title block, all of the attributes in question have a value (the block does not have a default value though, like most of the others in the block),anyway, there must be block reference "hiding" in the drawing w/o a value for the attribute. and that was the only one vba was finding.
MY PROBLEM REALLY HAD TO DO WITH:
while iterating through the layouts collection & making each layout active then iterating through the actual title blocks in each layout.
if i go thru .activelayout vba seems to find the same instance of the block 20 times (number of layouts).
if i go thru .paperspace it seems to find the actaul blocks and finds the proper property
 
Status
Not open for further replies.
Back
Top