Layers are quite tricky, especially if you don’t know the Layer names. If the layers don’t have names, or have the same names, then some things won’t work.
If everything is fixed, and you know the layer names, you can simply adjust the scrollbar and then set the layer. The scrollbar can be set to the top by using the number of layers minus 1, so if you’ve got 16 layers then:
[ISet,Tool:Layers:Layers Scrollbar,0,15]
will set it to the top. You need to adjust the scrollbar so that the layers you want are visible. Then you can simply set a layer using its name:
[ISet,Tool:Layers:Eyes,0]
Once you set all those eight layers then you’d just subtract 8 from whatever the scrollbar is set to so that the next eight layers show:
[ISet,Tool:Layers:Layers Scrollbar,0,7]
Anyway, if you don’t know the layer names you have to find them as you go. This means you have to step up or down the layers using the SelectUp or SelectDown buttons. This isn’t very fast but it is the only reliable way of doing it (that I’ve found).
I’ve attached a script that demonstrates the method when you don’t know the layer names. Load it using the Load button in the ZScript palette and then press ‘H’ on the keyboard. You should then see the two buttons in the section at the bottom of the interface.
There are two buttons. The TurnOff button turns off all the layers and stores their intensity values. The TurnOn button resets the layers. In both cases the layer that was selected at the start is reselected.
I’ve not included turning off the first eight layers. This won’t be difficult to do but it depends a little on what you want to happen.
Is this for your ZBuilder? If so, I can help make a plugin rather than relying on macros. Send me a PM if you want to discuss privately.
SetLayers.txt (3.53 KB)SetLayers.txt (3.53 KB)