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 script
But 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 = falseIt might not be beautifull, but it works

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement