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

    Code to eyedrop

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 4 Posters 933 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 Offline
      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 Offline
        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 Offline
          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 Offline
            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
            • 1 / 1
            • First post
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement