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:
ents.grep(Sketchup::ComponentInstance).each do |e|
mod = Sketchup.active_model
sel = mod.selection
selection = sel.grep(Sketchup::ComponentInstance)
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?