SOLVED by TIG - How can I select all vertical faces?
-
I have created a basic 3D model of an area, to show a new housing development in context.
I would like a way to quickly select all vertical faces, so I can paint on a colour for walls, then pick all sloping faces to apply a roof material.
I can't figure out a way to do tis with the default SKUP tools - is there a plugin available that can do the trick?
I've tried ThomThoms Selection Tools (v.2.2), it can select almost everything but what I'm looking for! -
These one-liners will do this kind of thing...
Type or easier Copy+Paste into the Ruby Console +<enter>ALL vertical faces in selection
s=Sketchup.active_model.selection;a=s.to_a;s.clear;a.grep(Sketchup;;Face).each{|f|s.add(f)if f.normal.z==0}
ALL horizontal [up] faces in selection
s=Sketchup.active_model.selection;a=s.to_a;s.clear;a.grep(Sketchup;;Face).each{|f|s.add(f)if f.normal.z==1}
ALL sloping [up] faces in selection
s=Sketchup.active_model.selection;a=s.to_a;s.clear;a.grep(Sketchup;;Face).each{|f|s.add(f)if f.normal.z>0 && f.normal.z<1}
To do it for all active_entities [no preselection].
ALL vertical faces in active_entitiesm=Sketchup.active_model;s=m.selection;s.clear;m.active_entities.grep(Sketchup;;Face).each{|f|s.add(f)if f.normal.z==0}
ALL horizontal [up] faces in active_entities
m=Sketchup.active_model;s=m.selection;s.clear;m.active_entities.grep(Sketchup;;Face).each{|f|s.add(f)if f.normal.z==1}
ALL sloping [up] faces in active_entities
m=Sketchup.active_model;s=m.selection;s.clear;m.active_entities.grep(Sketchup;;Face).each{|f|s.add(f)if f.normal.z>0 && f.normal.z<1}
-
TIG,
Thanks very much.
I've just tested them & all but one work perfectly. The "ALL sloping [up] faces in selection" doesn't pick up a slope in the selection, but the "ALL sloping [up] faces in active_entities" does.
Thanks again. -
There was a typo in the 'faulty' line of code.
I've corrected it in the original post - if you want to re-get it...
I typed all of those one-liners from memory, without any testing - so we were lucky that only one had a typo ! -
TIG,
@unknownuser said:
I typed all of those one-liners from memory, without any testing
That's just showing off now...
Just tested - works perfectly, thanks again. -
And you can blend these lines also with Inverse Selection by TIG!
-
You can test my plugin
http://extensions.sketchup.com/en/content/s4u_selectool
Advertisement