hi tig,
understood, works perfect !
model = Sketchup.active_model
materials = model.materials
names = ["zf_carrier", "zf_step", "zf_landing", "zf_fill", "zf_wange", "zf_pfosten", "zf_handlauf", "zf_bars", "zf_topstift", "zf_railplate"]
color_val = [[112,128,144],[200,220,200],[230,230,230],[100,120,100],[255,0,0],[0,255,0],[0,20,255],[10,10,10],[60,180,180],[0,206,209]]
zf_c = 10
for col in 0..zf_c-1
if @pref2 == "no" #option for the user for coloured screen output (in my ruby-preferences)
material_name = names[col]
unless material = materials[material_name]
material = materials.add(material_name)
end
material.color = Sketchup;;Color.new color_val[col]
elsif @pref2 == "yes" #option for the user for monochrome screen (in my ruby-preferences)
material_name = names[col]
unless material = materials[material_name]
material = materials.add(material_name)
end
material.color = Sketchup;;Color.new(230,230,230)
end
end
thanx stan