.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to explode a block programmatically

2 REPLIES 2
Reply
Message 1 of 3
dean0267
695 Views, 2 Replies

How to explode a block programmatically

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 ?
2 REPLIES 2
Message 2 of 3
JamieVJohnson
in reply to: dean0267

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
Message 3 of 3
NathTay
in reply to: dean0267

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost