Persistent locking and hiding


#1

@stevebaer


Hi Steve,
since you did not pull in the above request I assume I am not understanding the persistent setting correctly. Still, without the settings I am not able to get rs.LayerVisible(l, visible=False) to work according to the Rhino UI. Please see the description of the problem I found below. So my question is, how can I switch off a child-layer in the same way as pushing the light bulb in Rhino’s layer editor with LayerVisible() and without the changes from the pull request?
Thanks, Silvan

GitHub Pull request text:
Without this line layers that have been switched off with LayerVisible(l, visible=False), behave strangely when they have parent layers. If the parent layer is switched on and the child layer is switched off via the
function, it will not be fully off as in pushing the light bulb in the layer editor UI. The child layer is in the state that it would have, when the parent layer would be switched of (the half light bulb). This behavior is in contrast to the behavior achieved with the UI. Furthermore, when a child layer is in this weird hidden state and any layer is switched to locked with the button in the layer manager, the hidden child layer switches back on.


(Menno Deij - van Rijswijk) #2

This could be related to the issue below, because I cannot in any way get visibility to behave from code either. It would be very nice to get this sorted :smile:


#3

I have had a somewhat similar issues with Rhino 5 SR5. Haven’t tried with newer versions.
One creates a parent layer with its visibility set to False, and then a few child layers of that parent layer, which visibility is set to True (I haven’t even set the visibility, which means “True” will be used by default). If I manually (from Rhino) or by using Layers.Delete method, delete the parent layer, and then afterwards try to create the same parent and child layers (mentioned in the upper second sentence) by running the same code, all child layers get their visibility set to “False” for some reason.