Help with syntax of OneLayerOn syntax

_-OneLayerOn _SelectObject _Pause _Enter

I’m trying to create an alias that turns off all layers except for the layer of the selected object. The current alias works, but only if nothing is selected beforehand. I want it to function correctly in both cases: whether objects are already selected or selected after initiating the alias."

The following script might help… It also allows you to select multiple objects for multiple layers to be left on.
MultiObjLayersOn.py (736 Bytes)

Here is the companion, turns selected object(s) layer(s) OFF.
MultiObjLayersOff.py (892 Bytes)

1 Like

Thanks!