Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download
Assign a material in the ruby console
-
I have tried to add a material to some of the faces in my model and I get the error material [Brick_Antique]" not found. Could someone show me the correct way to assign a material to a face
for i in 1..10 faces[i].material= "[Brick_Antique]" -
Hi, here is an example;
model = Sketchup.active_model ; ents = model.entities ; materials = model.materials ; m = materials.add "name for material" ; texture = m.texture = "c;\\Users\\User\\Desktop\\folder\\texture.jpg" ; m.texture.size = 60 ; use_texture = true ; #Change to false to use color only faces = ents.grep(Sketchup;;Face) ; faces.each do |e| if use_texture e.material = m else e.material = [190,190,190] #Use color instead of textures end ; end ;Note: By the way there is a Developers forum section which might get you better answers to your questions.
Cheers!
-
Thanks that worked really well.
Advertisement