I’ve seen some posts talking about how to get layer count, but all the solutions are making srollbar’s y value to 256. What if there are more layers? I’ve tried to use recursive function and change the loop time variable inside the loop function. Both of them didn’t work.
I don’t know if you can have more than 256 layers but you can set the scrollbar to a higher number, such as 1024 and it should work OK.
I test it with zscript that loop for 300 times pressing Tool:Layers:New, then rename all layers with the loop index.
Is there a max value for layer count?
I’ve test with looping 1024 times and found that the max value is 512, then I won’t be able to create new layer.
OK, so you know that there can be a maximum of 512 layers and you can get the number of layers like this:
[ISet,Tool:Layers:Layers Scrollbar,0,512]
[VarSet,numberOfLayers,[IGetSecondary,Tool:Layers:Layers Scrollbar]+1]
Thanks, i’m now using this method.
1 Like