Grasshopper - Import content - organize - bake

Hi everyone,

I’ve been experimenting with Rhino components in Grasshopper by importing a 3D CAD file exported from Revit, and then baking the objects while preserving attributes like layers and colors. I also want to organize them under a main parent layer.

However, after baking into Rhino, I encounter two issues:

Layers get duplicated—appearing both inside the parent layer and separately outside of it.
All objects bake into a single layer instead of maintaining their original layer structure.
Is there something I am doing wrong?

See my attempt in the screenshot below. Any help would be greatly appreciated!

Thank you in advance.

@martinsiegrist @inno @AndyPayne

Is it possible to get a copy of the Rhino file and GH definition (the image is a little small to make out what’s happening). You can upload a file privately here. If that won’t work, could you put together a simplified example which shows the behavior you’re seeing?

Hi Andy, thank you. i have sent both .gh & .dwg files

I had a look at the file that you sent in. First off, it’s not a complete duplicate number of layers. For example, You have 26 sublayers under the zref 3d main layer. However, I only count 19 layers that are at the root level. My hunch is that your block definitions are still using the root layer reference assignments, but the block instances are reassigned to the zref 3d sub layer… and when you bake a block instance, it first has to bake the block definition… so in the process of baking the definition, it creates those root level layers, and then it bakes the block instance whereby it creates the sublayers. Does that make sense?

yes, that makes perfect sense, thank you so much for the explanation. Is there a way I can explode all the blocks and bake them with all the origin attributes?