@tntdavid said:
Now, I only want to select the instances present in a selection of components.
Then use the grep method that TIG showed you to collect all instances in the selection set.
http://sketchucation.com/forums/viewtopic.php?f=180&t=68172&p=626519#p626479
Then build an array of definitions for those instances.
Then unique the array so that each definition reference appears only once in the array. (Or use a set.)
(And read the several examples in the SketchUp forum thread I pointed to above.)
@dan rathbun said:
There are some code examples here:
https://forums.sketchup.com/t/selecting-specific-entity-group-or-component-by-name/11469