sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Add hidden layer

    Scheduled Pinned Locked Moved Developers' Forum
    8 Posts 3 Posters 671 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      Jorgensen
      last edited by

      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

      sketchup pro 2016 16.1.1449 64 bit | windows 10 pro | i7-3770k @3.5 GHz | 16gb ram | gtx 780 ti / gtx 980 ti | nvidia driver 368.39

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jorgensen
        last edited by

        ok, I figured it out to automatic add a new scene with the same name as the layer
        page = model.pages.add newname

        But how do I turn all the other layers off, except the one just added, in this new scene ?

        sketchup pro 2016 16.1.1449 64 bit | windows 10 pro | i7-3770k @3.5 GHz | 16gb ram | gtx 780 ti / gtx 980 ti | nvidia driver 368.39

        1 Reply Last reply Reply Quote 0
        • R Offline
          remus
          last edited by

          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
          }
          

          http://remusrendering.wordpress.com/

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jorgensen
            last edited by

            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

            sketchup pro 2016 16.1.1449 64 bit | windows 10 pro | i7-3770k @3.5 GHz | 16gb ram | gtx 780 ti / gtx 980 ti | nvidia driver 368.39

            1 Reply Last reply Reply Quote 0
            • J Offline
              Jorgensen
              last edited by

              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

              sketchup pro 2016 16.1.1449 64 bit | windows 10 pro | i7-3770k @3.5 GHz | 16gb ram | gtx 780 ti / gtx 980 ti | nvidia driver 368.39

              1 Reply Last reply Reply Quote 0
              • R Offline
                remus
                last edited by

                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.

                http://remusrendering.wordpress.com/

                1 Reply Last reply Reply Quote 0
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  Try this: http://forums.sketchucation.com/viewtopic.php?p=345385#p345385
                  [EDIT; AddPage.rb has been moved to its own thread...]

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    Jorgensen
                    last edited by

                    @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 newname

                    layers.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 πŸ˜„

                    sketchup pro 2016 16.1.1449 64 bit | windows 10 pro | i7-3770k @3.5 GHz | 16gb ram | gtx 780 ti / gtx 980 ti | nvidia driver 368.39

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    Buy SketchPlus
                    Buy SUbD
                    Buy WrapR
                    Buy eBook
                    Buy Modelur
                    Buy Vertex Tools
                    Buy SketchCuisine
                    Buy FormFonts

                    Advertisement