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

Nested block position in model/paper space.

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Ertqwa
808 Views, 4 Replies

Nested block position in model/paper space.

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.

4 REPLIES 4
Message 2 of 5
arcticad
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))
Message 3 of 5
Ertqwa
in reply to: arcticad

Ok, ty for the info.

Message 4 of 5
DiningPhilosopher
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).

Message 5 of 5
rf8862
in reply to: arcticad

How to calculate,I need an example,Thanks 95786236@qq.com

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