Deleting a layer, including its objects and objects within blocks

Is there any way of scripting this?

Often imports from other software create needlessly complex layer structures - this would help a lot, without forcing the user to explode all blocks.

yes.
(is this a wish / feature request ? - name it like this).

I fear, the blocks might get a bit tricky to modify…
(also if there are nested blocks)
These are the starting points:
https://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_DocObjects_InstanceDefinition.htm
https://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_DocObjects_Tables_InstanceDefinitionTable.htm

also check the samples provided here:

hope that get s you started - kind regards -tom

rhinopython/spb_Layer_delete.py at master · CADacombs/rhinopython · GitHub
rhinopython/spb_Layer_merge.py at master · CADacombs/rhinopython · GitHub

1 Like

Amazing, thank you!