Valued Contributor
Posts: 92
Registered: ‎10-03-2011
Message 1 of 4 (285 Views)
Accepted Solution

Nested block position in model/paper space.

285 Views, 3 Replies
02-07-2013 12:06 PM



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.

*Expert Elite*
Posts: 1,285
Registered: ‎06-21-2004
Message 2 of 4 (272 Views)

Re: Nested block position in model/paper space.

02-07-2013 01:03 PM in reply to: Ertqwa

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.


(defun botsbuildbots() (botsbuildbots))
Valued Contributor
Posts: 92
Registered: ‎10-03-2011
Message 3 of 4 (244 Views)

Re: Nested block position in model/paper space.

02-08-2013 10:56 AM in reply to: arcticad

Ok, ty for the info.

Valued Mentor
Posts: 370
Registered: ‎05-06-2012
Message 4 of 4 (221 Views)

Re: Nested block position in model/paper space.

02-10-2013 03:29 PM in reply to: Ertqwa

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).

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.