Is there a way using Grasshopper to delete the last layer from the sublayer full path name ? To complicate things the number of sublayers can vary and the name of the last sublayer can also vary.
I need to be able to select breps using the layer one layer up from the last layer in the full path text string.
If someone can point me in the right direction it would be most appreciated.
It would have been nice of you to supply a list of paths. After adding some deeper nested layers, I used @magicteddy’s paths instead (thank you!). NOTE: It appears to me that his C# Script works only when the GH file is opened and otherwise ignores layer changes? Your might find the standard GH Object Details component handy for getting layer names.
The standard GH Text Split works only with single characters. Using two colons (“::”) as the separator produces a messy result so I wrote a simple Python text splitter: pTxtSplit: