• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Code to eyedrop

Scheduled Pinned Locked Moved Developers' Forum
4 Posts 4 Posters 916 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 8 Feb 2016, 14:55

    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
    • P Offline
      Pixero
      last edited by 8 Feb 2016, 15:33

      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 8 Feb 2016, 16:07

        @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
        • T Offline
          thomthom
          last edited by 9 Feb 2016, 11:30

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

          Advertisement