.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Block Handle

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
896 Views, 2 Replies

Block Handle

 

Hi,

Is is possible to get the block handle from an attribute reference? I get the attribute reference from a previously stored attribute collection. I did try attref.BlockId.Handle.Value.ToString(), but it gives a different value, not the block's id.

 

Thanks

2 REPLIES 2
Message 2 of 3
chiefbraincloud
in reply to: Anonymous

Try OwnerId instead of BlockId.  Sorry, no time to try it myself.

Dave O.                                                                  Sig-Logos32.png
Message 3 of 3
jeff
in reply to: chiefbraincloud

Answer posted for same question at theSwamp without code example

 

attref.BlockId.Handle will give you the Handle for the Space it is inserted in.
So Model Space's handle if inserted in Model Space.

If you are wanting to get the BlockTableRecord(Block or Block Definition) Handle for the BlockReference that contains the AttributeReference in it's AttributeCollection Property then

You should be able to get the BlockReference from the AttributeReference.OwnerId property then
use the BlockReference.BlockTableRecord to get the Block and get its Handle.

 

 

 

You can also find your answers @ TheSwamp

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost