Created
October 14, 2016 14:59
-
-
Save madeindjs/6d1fbfcca2264cbbc73178c7ee63f212 to your computer and use it in GitHub Desktop.
Sketchup script to quickly change colors on many Sketchup::ComponentInstance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# search all Sketchup::ComponentInstance included partial_name and apply a material | |
def apply_material_on_all_instance material_name, partial_name | |
material = Sketchup.active_model.materials[material_name] | |
Sketchup.active_model.definitions.each{|d| | |
if d.name.include? partial_name | |
puts d.name | |
d.instances.each{ |inst| | |
inst.material = material | |
puts "\tinstance colored" | |
} | |
end | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment