sketchucation logo sketchucation
    • Login
    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

    Change Color of a model

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 654 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      gogcam
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • G Offline
        Gjenio
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • T Offline
          todd burch
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • G Offline
            gogcam
            last edited by

            
            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.mm
            
            

            Thats 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

            1 Reply Last reply Reply Quote 0
            • T Offline
              todd burch
              last edited by

              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

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement