Attribute showing block’s handle

Attribute showing block’s handle

mike
Contributor Contributor
790 Views
6 Replies
Message 1 of 7

Attribute showing block’s handle

mike
Contributor
Contributor

I need to create an attribute in a block that shows that block’s handle unique HEX identifier.  I tried creating an attribute then pasting this text to create a field for that attribute’s value, but all I see is that field showing the value “Handle” rather than the block’s actual handle HEX value:  

%<\AcObjProp.16.2 Object(?BlockRefId,1).Handle>%

I tried deleting the block from model space then re-inserting it, tried a regen, but still not seeing that attribute field properly returning the block’s handle.  Am I doing something stupid that’s preventing this from working?  Thanks.

0 Likes
Accepted solutions (1)
791 Views
6 Replies
Replies (6)
Message 2 of 7

vladimir_michl
Advisor
Advisor

Seems to work here (AutoCAD 2025.1). Setting an attribute, with the default value of:
%<\AcObjProp.16.2 Object(?BlockRefId,1).Handle \f "%tc1">%

Saving the block, performing BATTMAN, inserting new blocks, REGEN.

 

Vladimir Michl, www.arkance.world  -  www.cadforum.cz

0 Likes
Message 3 of 7

mike
Contributor
Contributor

This issue is confusing me.  I follow the same simple order of operations and I'm still only seeing HANDLE for the returned value, rather than the block's hex handle.

0 Likes
Message 4 of 7

vladimir_michl
Advisor
Advisor

Does it work in a plain FIELD? Also try to check the FIELDEVAL variable.

 

Vladimir Michl, www.arkance.world  -  www.cadforum.cz

 

0 Likes
Message 5 of 7

mike
Contributor
Contributor

I just tried replacing it with a date field, and that worked fine.  My FIELDEVAL is set to 31 (I also tried 16).  Still not working on my end.  Are you able to post a simple DWG file where you have it working with a block?  Thanks!

0 Likes
Message 6 of 7

vladimir_michl
Advisor
Advisor
Accepted solution

Sure - here  it is. Try to copy the row of block references and perform a REGEN.

 

Vladimir Michl, www.arkance.world  -  www.cadforum.cz

 

0 Likes
Message 7 of 7

mike
Contributor
Contributor

Vladimir, I really appreciate you helping with this.  Once I saw the test block in your DWG file, I realized that the fact that I had text in my attribute's Prompt space was causing the issue.  Deleting that text now allows that handle field to correctly show when my block is inserted.  Thanks!