.NET

.NET

Reply
Valued Contributor
Ertqwa
Posts: 99
Registered: ‎10-03-2011
Message 1 of 4 (297 Views)
Accepted Solution

Nested block position in model/paper space.

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

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.

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.

*Expert Elite*
arcticad
Posts: 1,285
Registered: ‎06-21-2004
Message 2 of 4 (284 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
Ertqwa
Posts: 99
Registered: ‎10-03-2011
Message 3 of 4 (256 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
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 4 of 4 (233 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).

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.