As you know we can have a materials name list by using the following codes.
my_mat_names =  Sketchup.active_model.materials.each do |mt| my_mat_names << mt.name end mat_list = my_mat_names.join('|') prompts = ["Material"] defaults = ["white"] list = [mat_list] title = "Material" choice = UI.inputbox( prompts, defaults, list, title )
It is the list of materials that we used in our model, not complete SU materials. Of course, by using the following code we can add materials from SU.
my_mat = nil filename = 'Materials/.../Mat_Name.skm' path = Sketchup.find_support_file(filename) materials = Sketchup.active_model.materials my_mat = materials.load(path)
Adding materials one by one is so difficult also different SU’s have different materials.
1- How can we add all of the materials in SU to our list?
2- How can we add a special material in our plugin and will be available in all SU’s?
Your help will be highly appreciated.