Creating Full Path Layers with Rhino Common / Scriptcontext (sc.doc)

More out of interest as i have found a work around where i get the status trigger from the elefont bake layers component but is it possible to write the script below using full paths in Rhino Common / Scriptcontext. so my whole code is written in the same way.

Would also be great to understand turning them off without having to also use rs.layervisable.
I have found the IsVisible in Rhino Common Doc Objects but not how to set it for the layer using the layer ID

Hi @mattgaydon, the post linked is a bit older, in Rhino 8 you can now use:

scriptcontext.doc.Layers.AddPath("Alpha::Beta::Gamma")

the mentioned bug in rs.AddLayer seems to be gone, so this works too:

rs.AddLayer("Alpha::Beta::Gamma")

to get the layer from a layer ID you might use this method, then change IsVisible.

does that help ?

_
c.

Seems to thanks, The project had been developed in 7 so this didn’t seem to be an option, then but works in RH8