Hello,
BlockTableRecord.Position gets the position of the block in its owner. So if it is a nested block, it gets the postion inside the parent block.
I want to get the position of a nested block in the space (model or paper). One way of doing this is getting the location of that parent, and if the parent is also nested, get that position and so on...and then calculate the position of the nested block.
Is there a faster way? A method that does this?
Thank you.
Solved! Go to Solution.
Solved by arcticad. Go to Solution.
AFAIK: the nested block is only giving the information from the block definition. it doesn't contain any 'real' information about where it is in space. So you would have to find the last block that is referenced in the space and work the math out.
I'm not sure what the person that posted your reply was thinking, but what it says isn't really true.
You can call Explode() on a BlockReference to get the entities in the block's definition transformed to space that contains the block reference, and just Dispose() the entities after you've gotten what you need from them. Explode() doesn't add entities to the database, so it doesn't get changed. That's how many AutoCAD commands support nested entities.
If you don't want to take the Explode() route, you need to identify what nested entities you're interested in, and use the BlockReference's BlockTransform property to transform geometry or coordinates to the owner space of the block reference (which is essentially what Explode() does with each nested entity).
Can't find what you're looking for? Ask the community or share your knowledge.