I am just learning Ruby (cough cough) and just doing the basics and already hit a wall. I am just trying to add new materials using ruby but I keep getting duplicate materials just with the added 1,2, etc…) is there a way to look and see if the material exists and skip that one?
Get a handle to all the materials in the current model.
model = Sketchup.active_model
materials = model.materials
material = materials.add(‘Joe’)