Selecting Groups by Name
-
Is there an easy way to select all groups that have the same name?
I have imported a large model from Tekla, it has not created separate layers but it has grouped each assembly. One group for each column etc. I want to texture all the steel, concrete, asphalt etc differently but this would be a very time consuming processes unless I can easily select all groups with the same name. Unless there is another way?
Cheers,
James
-
@jamesn320 said:
Is there an easy way to select all groups that have the same name?
I have imported a large model from Tekla, it has not created separate layers but it has grouped each assembly. One group for each column etc. I want to texture all the steel, concrete, asphalt etc differently but this would be a very time consuming processes unless I can easily select all groups with the same name. Unless there is another way?
Cheers,
James
Your example is a component instance so I assume that is what is to be selected rather than groups.
The following code can be pasted into the Ruby Console and executed to select Component instances by name
mod = Sketchup.active_model ent = mod.active_entities sel = mod.selection cin = ent.grep(Sketchup;;ComponentInstance).map{|ci|ci.name}.uniq.sort ipb = UI.inputbox(["Name to Select;"],[cin[0]],[cin.join("|")],"Select by Name") if ipb sel.clear ent.grep(Sketchup;;ComponentInstance).each{|ci| sel.add ci if ci.name==ipb[0] } end
-
Wow! Thanks. That is exactly what I wanted. I have never used the Ruby Console before. Your code even adds the different groups names to the drop down menu.
Thank you very much!
James
-
I feel like I am about to go on a steep learning curve, is it possible to add that script into a button on the tool bar?
Cheers,
James
-
I've got it to now be on the drop down menu, Happy days.
Advertisement