Eneroth 3 and Dan,
I have analyzed your methods and I am unable to know who is right. 
In your 2 examples, you use definition_ :
definition_a is the list of components to observe?
defintion_b is the list of sub-components to be identified in definition_a?
If yes, should I proceed like this:
["IKEA-MB","IKEA-MH"].each do |liste1|
a = /#{liste1}/
mod = Sketchup.active_model
sel = mod.selection
mod.definitions.each do |d| sel.add d.instances if d.name=~a
I still lack experience in ruby, to use your code snippet in my methods.
More details would be really appreciated.
_
Another question that has nothing to do with your examples.
I learned that it is possible to browse a table and execute a method on any element of the list.
For the moment I still lack technical words to be explicit so here is an example:
a = ["Handles","Feet"]
mod = Sketchup.active_model
sel = mod.selection
mod.definitions.each do |d| sel.add d.instances if d.name==a[0]
end
This code example selects “Handles”.
If I change the value to “1” instead of “0”, “Feet” will be selected.
This can be useful if I want to apply methods to “Handles” without affecting “Feet”.
For example, count the “Handles” entities separately from “Feet”, and apply the deletion only if one of them is> 1.
But I have a problem with this solution:
This method only applies if the definitions are strictly == “IKEA-MB”.
How to use this method for all made unique definitions like “IKEA-MB”, “IKEA-MB # 1”, “IKEA-MB # 2”?
Note :
With the method “each”, “a == [0]”, no longer works.
How can I get around the problem?
Thank you in advance for your help.
David