Welcome to the CADTutor forums, probably the most lively and friendly AutoCAD forums on the web. You will need to register in order to post a question and to see all the content on this board. See How to register for details. Use the Lost password recovery form if you ever forget either your password or username. Be sure to check out the FAQ for more information.

Unfortunately there are many different blocks, most of them only occur once or twice within my drawing. I was hoping to select all the blocks and explode all of the nested blocks so that they retain their block definition but only on one level rather than the several levels that they are currently on.

Thanks for the reply. I tried to use your code above but I got the response "No unreferenced blocks found." and when I enter the block editor to see if it has removed the nested block the nested block is still there. Is this code trying to purge out unreferenced blocks?

I was looking for something that would allow you to select the blocks (with a window), that would then enter the block editor and explode everything but have the original block remain as a block. At the moment I have to enter the block editor for each block and explode the nested blocks myself but this is very time consuming as there are so many different types of blocks (with nested blocks inside of them).

Lee Mac's Computer Details

Lee Mac's Discipline Details

Discipline

Multi-disciplinary

Details

Custom Programming / Software Customisation

Using

AutoCAD 2013

Join Date

Aug 2008

Location

London, England

Posts

19,456

Originally Posted by Cazza

I tried to use your code above but I got the response "No unreferenced blocks found." and when I enter the block editor to see if it has removed the nested block the nested block is still there. Is this code trying to purge out unreferenced blocks?

My program will iterate over all block definitions within the block collection, and, if a block definition contains a nested block, the nested block is exploded. Finally, the program will purge the block collection to remove any unreferenced block definitions.

The code seems to work fine in my tests, even with blocks for which the 'Allow exploding' option is unticked.