Explode nested block references with loop

Hi all, long time reader but first time poster so aplogies if i mess something up :slight_smile:

Bit of background:
I have multiple DWGs containing nested block references. The number of layers the block references are nested varies from DWG to DWG. All the block references and their nested block references need to be exploded so I only have the 3D-solids at the bottom layer of each nested block reference.

What I’m trying to do is to explode the block references and their nested block references by exploding them one layer at a time. The problem is that I don’t know how many layers of nested block references there are and I need the script to be able to adapt to different DWGs with varying amount of nested block references.

The actual problem:
Is there any way to loop this workflow (see image below)? If i have block references in the list of “Objects.explode” node at step 4 in my graph can i make it loop back to the start of part 3 of my graph?

Any help is much appreciated.

Hi @Bimbimbim ,

You could probably do this with Python, but I don’t really know how to create something that also uses Dynamo nodes/ commands in it.

You could probably also repeat this part 5 times or so.

I don’t think there is a good way without Python to loop