• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    Valued Contributor
    Ertqwa
    Posts: 79
    Registered: ‎10-03-2011
    Accepted Solution

    Nested block position in model/paper space.

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

    Please use plain text.
    *Expert Elite*
    arcticad
    Posts: 1,259
    Registered: ‎06-21-2004

    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.

    ---------------------------



    “We don’t have a snowball’s chance in a blast furnace of surviving this attack unless every one of our units gets into the fight right now!”
    Please use plain text.
    Valued Contributor
    Ertqwa
    Posts: 79
    Registered: ‎10-03-2011

    Re: Nested block position in model/paper space.

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

    Ok, ty for the info.

    Please use plain text.
    Valued Mentor
    Posts: 342
    Registered: ‎05-06-2012

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

    Please use plain text.