rs.LayerLocked Unexpected Hierarchy Behavior

Hi,

Using rs.LayerLock to lock the child layer results in semi-lock mode. In normal usage this happens only if the parent is locked. Why is it different in scripting? Is it by design?

It seems in normal usage Rhino automatically check if the parent layer is locked or not.
You can use SetPersistentLocking method like this:

import Rhino
i = Rhino.RhinoDoc.ActiveDoc.Layers.FindByFullPath('One::Two::Three', -1)
layer = Rhino.RhinoDoc.ActiveDoc.Layers[i]
layer.IsLocked = True
layer.SetPersistentLocking(True)

Thank you for the workaround @Mahdiyar,

I still think that rs.LayerLocked should act as in normal Rhino usage. Especially because rs.LayerVisible acts as expected. It also has forcevisible_or_donotpersist parameter. There is no equivalent parameter for rs.LayerLocked.

Maybe I am nitpicking.