Smart Selection


#1

Hi,

How to select just these triangles inside complex geometry?

Kind Regards.


#2

I don’t think it’s really a question of smartness! It depends on what you specify to be selected and on what selection tools (and extensions) you have available.

What distinguishes these internal triangles from the surrounding geometry?

  • they are faces and have three vertices
  • they likely have a bigger face area (if there is no asymmetric magnifying distortion)
  • they are 3rd order neighbors to the edge scaffold

I’m not sure if there are suitable extensions that have a UI for such a specialized task, but it would be trivial with some Ruby scripting:

triangles = Sketchup.active_model.selection.to_a.grep(Sketchup::Face).select{ |face| face.vertices.length == 3 }
Sketchup.active_model.selection.clear
Sketchup.active_model.selection.add(triangles)

which you use by opening Window → Ruby Console and pasting these commands and hitting enter.


#3

S4U Select will do it for you.


#4

You have pointed out very important points, so much thanks but the script does not work and gives following error.

2


#5

I corrected it, in Ruby it’s select.


#6

It works well, Thanks a lot.