sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Assign a texture to a group or component instance?

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 2 Posters 245 Views 2 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.
    • F Offline
      fizgig
      last edited by

      I can do it with the built-in ability of sketchup but I don't see a method to do it in Ruby. I'd prefer not to have to go into the sub-entities of a group and color all the items that don't have a material. Is there a trick?

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        Hi Fiz, the parent class of Groups and Components is the Drawingelement class. Anything that you can do to the Drawingelement class, you can do to its subclasses. So check out the Drawingelement class and you will see that you can assign materials to any drawingelement. Although, as I'm writing this, I'm having my doubts about it. That would indicate that color can be assigned to some things that I've never thought about assigning color to. I'm off to go experiment now.

        But the point is, that yes you just assign the material to a group or componentinstance like this:
        color = Sketchup::Color.new [0,0,200] my_group.material = color

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • Chris FullmerC Offline
          Chris Fullmer
          last edited by

          I think I see - section cuts and guides are specifically what I was thinking of that can not take individual color. Which is sort of true. They seem to ignore it if you change their color individually through ruby. But they do have color associated with them globally and it seems Ruby color is ignored. So I think my above thoughts are still correct, that anything you can do to the Drawingelement class can be done to its subclasses. I think. πŸ˜„

          Chris

          Lately you've been tan, suspicious for the winter.
          All my Plugins I've written

          1 Reply Last reply Reply Quote 0
          • F Offline
            fizgig
            last edited by

            Thanks Chris!

            Forgot all about the parent class idea. Still wrapping my head around this object-oriented approach. πŸ˜„

            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