exploding nested blocks

exploding nested blocks

Anonymous
Not applicable
717 Views
4 Replies
Message 1 of 5

exploding nested blocks

Anonymous
Not applicable
I'm trying to explode a block - which contains nested blocks...
AcDbEntity->explode doesn't work on the nested blocks - it's not even
telling me that the block contain nested blocks... What should be my
approach???

Thanks
-Partha
0 Likes
718 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
To explode all nested blocks:

Iterate over the block table.
For non-layouts, iterate over the block table record
For each entity in the block table record
If it is an AcDbBlockReference
Explode
Append returned entities to block table record
Delete the AcDbBlockReference object

That is about it... what are you trying to accomplish? What do you mean,
"it's not even telling me that the block contain nested blocks." - it won't
tell you unless you ask. How are you querying this?


"Partha" wrote in message
news:[email protected]...
> I'm trying to explode a block - which contains nested blocks...
> AcDbEntity->explode doesn't work on the nested blocks - it's not even
> telling me that the block contain nested blocks... What should be my
> approach???
>
> Thanks
> -Partha
>
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
Partha,

You will need to build a recursive function to explode an entity getting
those representative entities from explode() method. Walk through them, add
each one to database except if it is a BlockReference. In this case, call
the same function for this BlockReference (recursive method). Pay attention
to not delete what you will add to database and, once added, close each
entity. For those that are BlockReference you don't need to add once you
will explode them too.

At the end of all recursive calls you will have a set of new entities.

That is it!
I don't have any sample to send in...sorry but you will have to implement
this...

Regards,
Fernando.

"Partha" wrote in message
news:[email protected]...
> I'm trying to explode a block - which contains nested blocks...
> AcDbEntity->explode doesn't work on the nested blocks - it's not even
> telling me that the block contain nested blocks... What should be my
> approach???
>
> Thanks
> -Partha
>
>
0 Likes
Message 4 of 5

Anonymous
Not applicable
The problem is - when I'm using explode - the returned entityset doesn't
contain AcDbBlockReference objects anymore... So, if I append entityset and
delete AcDbBlockReference then nested AcDbBlockReference will be lost... I
know this problem may be solved by re-writing the explode function... I'm
trying to find out if there is any easier way.

I'm using Acad2000... I want to achieve something like 'bextend' (available
in Express) - where my program will extend some line upto an entity inside a
block.

-Partha
0 Likes
Message 5 of 5

Anonymous
Not applicable
If the entityset created from explode doesn't contain AcDbBlockReference
objects, then the blockdef didn't contain them in the first place.

If you are trying to implement a function similar to bextend, then you don't
have to delete the AcDbBlockReference anyway... you just have to iterate
through the entities in the exploded entity set to find your extended
intersections....

MS
"Partha" wrote in message
news:[email protected]...
> The problem is - when I'm using explode - the returned entityset doesn't
> contain AcDbBlockReference objects anymore... So, if I append entityset
and
> delete AcDbBlockReference then nested AcDbBlockReference will be lost... I
> know this problem may be solved by re-writing the explode function... I'm
> trying to find out if there is any easier way.
>
> I'm using Acad2000... I want to achieve something like 'bextend'
(available
> in Express) - where my program will extend some line upto an entity inside
a
> block.
>
> -Partha
>
>
0 Likes