How to explode a block programmatically

How to explode a block programmatically

Anonymous
Not applicable
960 Views
2 Replies
Message 1 of 3

How to explode a block programmatically

Anonymous
Not applicable
I am trying to explode a block within a block.
I tried it with SendStringToExecute(_EXPLODE ALL ",False,False,True) but when the statement has executed
it waits on me to hit Enter or any keystroke to unhighlight everything in AutoCAD.
Can anybody show me how to explode a block programmatically in vb.net ?
0 Likes
961 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Explode is a method of blocks (BlockTableRecord) that you can call in VB.Net. Once you call it, you only get a collection of the objects in the block, the original block is still intact. You have to remove the original block, and place the exploded entities where you want them.



If you want to explode a block inside of a block, merely, move the entities from one BlockTableRecord(Nested Block) into the other BlockTableRecord(Parent Block). Explode doesn't even need to be run.



jvj
0 Likes
Message 3 of 3

Anonymous
Not applicable
There is no Explode method of a BlockTableRecord as it is Block References that can be exploded not Block Definitions. There is an Explode method of the Entity object or ExplodeToOwnerSpace method of the BlockReference object.



As to simply moving obects from one BlockTableRecord to the other. If the OP does want to change the block definition so it has the nested block exploded as opposed to what I suspect they want which is to do a nested explode on the block reference. The BlockTableRecord for the nested block should stay in tact. The BlockReference of the nested block should be removed from the BlockTableRecord of the parent block. The entities from the BlockTableRecord of the nested block should be copied to the BlockTableRecord of the parent block.
0 Likes