Hide Layer's Children
Hello, I'm looking to make a script that toggles hiding a layer whose name is, for example, "CAD"
I got a basic script working that hides it OK, but if the layer has sublayers, which in most cases it does, it hides the parent, but the sublayers' visibility remains unchanged.
I searched the help files but there is no getchildren, or something like that.
I'd really appreciate some help since I've been struggling with this one for a while.
Here's my script:
for i = 0 to (layermanager.count - 1) do
(
x = layermanager.getlayer i
layername = x.name as string
location = findString layername "CAD"
if location == 1 do
(
if x.on == true then x.on = false
else x.on = true
)
)
Comments
.
If the names of the nested layers starts with "CAD" then their visibility state will be overwritten twice. Find a way to avoid that.
Build your own function to get all nested layers(nested layer in a nested layer in nested layer)
Tools and Scripts for Autodesk 3dsMax
Works like a charm! Thank you
Works like a charm! Thank you very much dude! Much, much appreciate it :)
I'll tinker around with it to get that extra functionality in it when I can and write the results here in case anyone else might find it useful.