AUTOCAD VBA - extacting attribute values
AUTOCAD VBA - extacting attribute values
(OP)
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?
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?





RE: AUTOCAD VBA - extacting attribute values
RE: AUTOCAD VBA - extacting attribute values
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