I have a question that will seem to you to be stupid after all the way we have traveled together hand in hand.
To find all the definitions of the entities present in the selection, we can write this:
def all_entities(ents) ents.grep(Sketchup::ComponentInstance).each do |e| p e.definition.name all_entities(e.definition.entities) end end mod = Sketchup.active_model sel = mod.selection selection = sel.grep(Sketchup::ComponentInstance) all_entities(selection)
This method displays all the definitions in all nesting levels.
But I only want to display the names of the entities that are nested at the deepest level in the parent component.
Do your know how to do this?