Change Color of a model
-
Hey there
I got a little question about changing the color of a model...
I have generated a table with ruby. Now I want to change the color or/and the material of it.
How can I do that?
Thanks a lot
Cheers,
gogcam -
You can use either color by layer (from the layer window) or just use the paint bucket tool choosing the material you want to apply
-
You can do it two ways, depending on how you have made the table.
The if the table is a group or component (g/c), you can apply a Material (or Color) to the g/c. If not, you can apply the Material or Color to each face (and/or edge). If you get stuck, post some code.
Todd
-
w = 2500.mm d = 2000.mm h = 1000.mm pts = [[0,0,h-40.mm], [w,0,h-40.mm], [w,d,h-40.mm], [0,d,h-40.mm]] base = container.add_face pts h = -h if base.normal.dot(Z_AXIS) < 0.0 base.pushpull 40.mmThats the main code for the base of the table. Sadly I have no clue how I can change the material or color of it. I googled a lot but somehow I didnt find anything really useful for a ruby newbie like me

Thanks for your help!
gogcam -
Try this:
w = 2500.mm d = 2000.mm h = 1000.mm pts = [[0,0,h-40.mm], [w,0,h-40.mm], [w,d,h-40.mm], [0,d,h-40.mm]] group = Sketchup.active_model.entities.add_group container = group.entities ; base = container.add_face pts h = -h if base.normal.dot(Z_AXIS) < 0.0 base.pushpull 40.mm group.material = "red" ;Todd
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement