Jump to content

How to correctly extract nested objects from blocks with scaling/mirroring)


Recommended Posts

Posted

Hi everyone,

I’ve been working on modifying Lee Mac’s “Extract Nested Block” routine. @Lee Mac
By default, his code only extracts a nested block reference.
I have expanded it so that it can also extract non-block objects (lines, arcs, etc.) located inside a nested block reference.

The problem occurs when the selected object is inside one or more parent blocks that have been scaled or mirrored.
In these cases, the extracted object is placed in the wrong position in model space.

I know the “correct” way to solve this is to traverse the block reference hierarchy and apply all transformation matrices (scale, rotation, mirror) step by step until we reach world coordinates.
However, in large DWG files with many nested blocks, this approach becomes very slow and hurts performance significantly.

My question is:
Is there a more efficient way to get the final WCS coordinates of a nested object, including all scaling/mirroring effects from its parent blocks, without manually multiplying all transformation matrices?

Any suggestions or examples would be greatly appreciated.

Thanks in advance!

Posted

Maybe something in my post or the one of Lee Mac's I linked...

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...