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!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Turn off all layers except selected?

    Scheduled Pinned Locked Moved Newbie Forum
    sketchup
    3 Posts 3 Posters 1.3k 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
      johnjohn78
      last edited by

      Hi All,

      Is there a plugin or method to turn off all layers except the geometry that is already selected?

      Thanks in advance

      John

      1 Reply Last reply Reply Quote 0
      • sdmitchS Offline
        sdmitch
        last edited by

        Make selection, paste following code into Ruby Console, press Enter.

        
        mod = Sketchup.active_model
        sel = mod.selection
        unless sel.empty?
          layers = []
          sel.to_a.each{|e|
            layers << e.layer
          }
          layers.flatten!;layers.uniq!
          mod.layers.each{|l|
            next if layers.include?(l)
            l.visible=false
          }
        end
        
        

        Nothing is worthless, it can always be used as a bad example.

        http://sdmitch.blogspot.com/

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

          You might also to want to trap to avoid trying to switch off the 'current layer' [which is usually, but not exclusively, Layer0], otherwise that could throw an error...

          TIG

          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