[Request] Select only horizontal and vertical faces
-
This has been discussed in several threads already... do a search.
This one-liner copy+pasted+<enter> in the Ruby Console leaves an existing preselection with just the horizontal [up] faces selecteds=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Face) && e.normal.z==1}
This one does horizontal up & down faces
s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Face) && e.normal.z.abs==1}
this one does all vertical faces
s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Face) && e.normal.z==0}
There are many permutations you could invent - for example after the desired faces are selected to also select their edges with
s=Sketchup.active_model.selection;s.each{|e|s.add(e.edges)if e.is_a?(Sketchup;;Face)}
-
@numerobis said:
Is there a plugin that allows to filter a selection to select only horizontal and vertical faces? And their outer lines? (the second part is not so important, because it can be done by grouping and ungrouping the selection)
Selection Toys let you do that: http://extensions.sketchup.com/en/content/selection-toys
-
We all posted replies very quickly ...I love sketchUcation!
-
Here is a code example...
model = Sketchup.active_model ents = model.active_entities sel = model.selection faces = sel.grep(Sketchup;;Face) edges = sel.grep(Sketchup;;Edge) faces.each do |face| if not face.normal.x == 1 || face.normal.y == 1 || face.normal.z == 1 || face.normal.x == -1 || face.normal.y == -1 || face.normal.z == -1 sel.remove face end sel.remove edges end
Note:forgot to add negative normal...updated the code above.
-
WOW! Thanks a lot for all these quick responses!
But i'm really a noob when it comes to ruby coding, so please... how can i turn these code parts into a plugin so that i don't have to open the console every time?
@tt_su said:
Selection Toys let you do that: http://extensions.sketchup.com/en/content/selection-toys
Thanks! I already reinstalled them because i thought i had an older version installed. But i still can't it? Maybe i missed it - could you tell me in which section it is located?
-
hm... it might not do exactly what you want. If you have a horizontal face you can right click it and in the context menu you can select more faces in the same direction or perpendicular.
...though I did imagine there was already a plugin to select Vertical, Horisontal faces...
-
-
@rich o brien said:
http://sketchucation.com/resources/pluginstore?pln=s4u_selectool_v1.1.1
Great plugin that does what he wants and then some!
-
@rich o brien said:
http://sketchucation.com/resources/pluginstore?pln=s4u_selectool_v1.1.1
Thanks Rich!It works! But now i see that i need a slight variation of "horizontal/vertical". When i select a rounded cube i need to filter out only the orthogonal faces (xy/xz/yz) and not the rounding. With horizontal/vertical the vertical faces of the round corners are selected too.
Would it be possible to limit the selection to these three directions? And would it work based on a local coordinate system of a component?
-
@numerobis said:
Is there a plugin that allows to filter a selection to select only horizontal and vertical faces? And their outer lines? (the second part is not so important, because it can be done by grouping and ungrouping the selection)
maybe this one, at least for part of what you are looking for
-
Thanks, but...
@rich o brien said:
http://sketchucation.com/resources/pluginstore?pln=s4u_selectool_v1.1.1
-
Here's my contribution:
http://sketchucation.com/forums/viewtopic.php?f=323&t=54894 -
Thanks Didier!
But i have two problems using it...
It also selects ALL vertical faces not only the axes oriented ones (same as the s4u_selectool). And it works not in groups/components for me.
Maybe i should describe why i need it...
When i use round corner i need to smooth the curve segments but i want the first edge of each rounding to stay unsmoothed to avoid shading problems when i render the model. This method works ok for me without the need of supporting edges.
So the best thing would be a "Soften Edges" tool that sets the minimal smoothing angle for each edge and sets the start and end edge to unsmoothed.
Maybe this could be an option of the round corner tool.
Advertisement