Get all blocks inside a block

Hello everybody,

Im quit new to AutoCad and now i want do get a collection of all blocks wich are inside another block in my C#/.NET Plugin. I found a way to get all blocks in a Polyline (thanks to _gile https://forums.autodesk.com/t5/net/find-block-inside-a-polyline/td-p/7586489).
Now i want to apply the same principle to the outline of a specific block.

Example:

Block Edit View of Block Room A
See attached Block RoomA.png

Example i want to get de Blocks marked with pink.
See attached Example1.png

So my idea is to somhow geht de outlining lines of the block to form a new poly line and then use the solution from _gile mentioned above. I have acces to all room block in my file as they are all on the same layer.

Thanks for your help!

Comments

  • faceter
    edited August 2019

    Hello,

    please define "block in block"
    -> geometric / location
    OR
    Datastructure -> BlockReferences inside BlockTableRecord?

    ~~lookat SelectionSet and TypedFilter. Using TypedFilter you can filter all blocks ( dxfcode 0 "Insert") and (dxfcode 8 layername)
    => GetAll(filter) creates the SelectionSet. (no polyline bounds) or use GetSElection(filter)
    Loop the SelectionSet , get the OID of the selected Obect AND/OR Convert the SeletionSet to ObjectIdCollection~~