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

Block Handle

1 REPLY 1
SOLVED
Reply
Message 1 of 2
fsl88
530 Views, 1 Reply

Block Handle

Good day,

 

I have a blockRef.Handle.Value (long data type), which is refering to a block. How can I access its x,y,z position , and rotation?

thanks.

Tags (3)
Labels (2)
1 REPLY 1
Message 2 of 2
_gile
in reply to: fsl88

You have to get the ObjectId of the block reference from its handle either with:

Database.GetObjetcId method

database.GetObjectId(false, blockRef.Handle, 0);

or with Database.TryGetObjectId method (not documented):

database.TryGetObjectId(blockRef.Handle(), out ObjectId id);

 Then you open the ObjectId for read and you can get the blockRef.Position.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report