Sub component selection

Hello,
Is it possible to select only a sub-component by adding it to the selection set like one can do with the outliner. Meaning also is component edit mode using ruby possible or still not ?
Olivier

Try something like:

component.definition.entities.each { |sub| Sketchup.active_model.selection.add(sub) if sub.definition.name == 'sub_component_name' }

You cannot change the ‘edit context’ into the nested target.
But you can reverse the edit context ‘up’ the hierarchy…

As suggested, you could use code to select objects which are currently within a nested context: but beware, cross-threading a selection across contexts is a certainty to make a big bug-splat!

What is it you want to do ?
Perhaps there’s a safer alternative approach ??

I want to display a window that will act like the outliner. Adding a component instance to the selection set by using its definition name seems to work without edit mode. Is there a better way to avoid any bug splat ?