I would like to delete some layers and the objects on those layers in Rhino from GH. They were previously generated by Human. I know there is a “Delete on Layer” component, but that only deletes objects and doesn’t delete in sublayers.
So what I have are the layer paths to delete in the typical format of “Layer::Sublayer::etc.”
Of course I am aware of the usual warnings.
Is there a way to do it with Python or C#? I found this https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_DocObjects_Tables_LayerTable_Purge.htm, which I think is the method to delete a layer and its contents, but not sure how to get the GUID of a layer based on its path and how to plug it all together.