Have you all played with AI Assistant in SketchUp 2026.1? With that you can ask a question like this:
“give me a ruby script that will select all groups and components that are using the same material“
It then gives you this:
model = Sketchup.active_model
materials = model.materials
# Prompt the user to select a material
material_names = materials.map(&:name)
selected_material_name = UI.inputbox(["Select Material:"], [material_names.first], "Material Selection")[0]
# Find the selected material
selected_material = materials[selected_material_name]
# Select all groups and components using the selected material
entities = model.active_entities
selection = model.selection
selection.clear
entities.each do |entity|
if entity.is_a?(Sketchup::Group) || entity.is_a?(Sketchup::ComponentInstance)
if entity.material == selected_material || entity.definition.material == selected_material
selection.add(entity)
end
end
end
You put that into Ruby Console, and when the dialog comes up you change the text to be the name of the material you’re interested in. It then selects all groups and components that are painted with that material.