Command to select all on same layer?
-
This works great for ungrouped lines or faces. Is there a way to do this with groups and components?
-
Not without Ruby...
This one-liner will work, select ONE object on the required layer and then copy/paste this code into The Ruby Console +<enter> and the selection will expand to include everything in the "current context" that's on that same layer...m=Sketchup.active_model;s=m.selection;l=s[0].layer;s.clear;m.active_entities.each{|e|s.add e if e.layer==l}
Here's a '
def
' version of it - it's probably a little clearer - you can copy this code into a file in ../Plugins/ called "selectbylayer.rb"def selectbylayer() model=Sketchup.active_model ss=model.selection layer=ss[0].layer ss.clear model.active_entities.each{|e|ss.add e if e.layer==layer} end#def
Then to run it you can type
selectbylayer
into the Ruby Console.
To add a Plugins Menu item add this extra code to the end of the new .rb file [after theend#def
]if not file_loaded?(File.basename(__FILE__)) UI.menu("Plugins").add_item(("Select by Layer"){selectbylayer()}) end#if file_loaded(File.basename(__FILE__))
To run it you pick "Select by Layer" off the Plugins Menu.
I'll leave the toolbar up to you... -
Selection Toys will let you do that:
http://forums.sketchucation.com/viewtopic.php?f=323&t=14975 -
Thanks, all. Just when you think you've reviewed all the plugins out there...
Advertisement