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!
    🚨 Skimp | 25% Off until March 30 Buy Now

    Assign a texture to a group or component instance?

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 2 Posters 319 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

            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 Login
            • 1 / 1
            • First post
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement