Lunchbox: Save a layer

I am just playing around with Lunchbox’s Object Save component and want to save the contents of a layer to a new .3dm file.

So far so good I thought, but the layer contains a lot of Block instances. Using the Layer Reference component they all get picked up:

But once you save it only saves the curves, but not the blocks.

The only part workaround I have found is to set the “Layer” input of the Save component to the same as the layer you are referencing. Then it will create the layer during the save (but it already exists), then selects the whole layer (so everything including the blocks) and then saves it as a .3dm just fine.

So only downside of course is that the very last action of the save component is to delete the layer:

So if there was a way to disable that last _delete step, it would work just fine.

Alternatively I tried to recreate what the save Component does using the Rhino command component (since it seems all the save component does is trigger a bunch of rhino commands), but I can’t figure out how you use it to trigger one command after another!?

Here are the 2 things I am trying, neither of which fully works:

reference_and_export.gh (18.5 KB)
01_D_C2-P1.3dm (2.2 MB)

Follow up question on this @archinate1:

How does the Object Save component save the Layers? Does it not use the same format of “layer::sublayer::sublayer” as Rhino? If I save it as for example a DXF file than instead of using the nested layers it just creates a single layer with the name “layer__sublayer__sublayer”. If I do the same from Rhino and export geometry in sublayers the layer is then just named “layer$sublayer$sublayer”. So I guess its also Rhino that doesn’t save layers in DXF files, but just flattens the name!?! I’ll post a separate bug report on that.

As for DXF files, because nested layers are not supported so sub-layers’ names are flattened.

Pancake “Export As” + Elefront

Pancake “Export to 3DM”, only when your blocks are not nested