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!
    ⚠️ Update | Sketchucation Tools 5.0.8 released with licensing improvements and bugfixes Download

    Code to eyedrop

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 4 Posters 1.1k Views 4 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.
    • D
      djrique
      last edited by

      Hi guys, my name rique, i've started to learn .rb and i would like to use eyedrop in my plugin to select a material in sketchup workspace and the material open in window with some datas about it...but i don't know what code i can use. Plz, somebody can help me?

      1 Reply Last reply
      Reply Quote 0
      • PixeroP
        Pixero
        last edited by

        Maybe this from the api:

        
        
            The current method is used to get the current material, i.e. the material that the user has selected in the Materials dialog.
        
            Returns;
        
            material
                a Material object.
        
             current = Sketchup.active_model.materials.current
        
        1 Reply Last reply
        Reply Quote 0
        • K
          kaas
          last edited by

          @djrique said:

          Hi guys, my name rique, i've started to learn .rb and i would like to use eyedrop in my plugin to select a material in sketchup workspace and the material open in window with some datas about it...but i don't know what code i can use. Plz, somebody can help me?

          That's quite a challenge to start learning ruby.

          Use google-search to find in the SketchUp Ruby API code about:

          • making a tool -> all the code you need for starting a plugin, moving the mouse, refreshing the view, stopping the tool etc
          • making a custom cursor -> for changing the cursor to a custom eyedropper icon
          • pick_helper -> for picking the material from a face
          • webdialog -> for opening a window to display your data
          1 Reply Last reply
          Reply Quote 0
          • thomthomT
            thomthom
            last edited by

            I got a simple tool to pick materials in Material Replacer: https://bitbucket.org/thomthom/material-replacer/overview

            You can use that as reference.

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            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