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...
Advertisement