Turn off all layers except selected?
-
Hi All,
Is there a plugin or method to turn off all layers except the geometry that is already selected?
Thanks in advance
John
-
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 -
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...
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