Add hidden layer
-
When I create different models to analyze, I often use the script "add_hidden_layer.rb" by Jim Foltz to add a layer that is hidden in already created scenes, and then add a scene like 05, where layer 05 is shown.
I would be greate if the scene (same name as the added layer e.g. 10) was added automatic - is this possible in ruby ?
Thanks
-
ok, I figured it out to automatic add a new scene with the same name as the layer
page = model.pages.add newnameBut how do I turn all the other layers off, except the one just added, in this new scene ?
-
Something like this should turn of all the other layers (untested, btw.)
Sketchup.active_model.layers.each {|layer| unless layer.name == "newname" layer.visible = false end }
-
Hi Remus
Does it turn off the other layers in the new created scene (page) - or is it in generel ?
What I need is, when I press the new scene, the only layer that is visible, is the one with the same name as the scene.I hope that I'm describe it ok
Thanks
-
Hmm, well I know how to add the page, but it 'remembers' everyting, I need it to only remember layers - is that possible ?
It might be simple, but I'm a total newbie
Thanks
-
Sorry, i didnt really read your post properly. The snippet i posted will hide all the layers except the named one. Not sure how youd get it to apply that to your scene, though.
-
Try this: http://forums.sketchucation.com/viewtopic.php?p=345385#p345385
[EDIT; AddPage.rb has been moved to its own thread...] -
@TIG
Thanks for your input, even though I couldn't understand your scriptBut I managed to get it to work by using this:
page = model.pages.add newnamelayers.each { |l| page.set_visibility(l, false)} page.set_visibility(layer, true) puts page.update(32) page.use_axes = false page.use_camera = false page.use_hidden = false page.use_hidden_layers = true page.use_rendering_options = false page.use_section_planes = false page.use_shadow_info = false page.use_style = false
It might not be beautifull, but it works
Advertisement