Code to eyedrop
-
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?
-
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
-
@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
-
I got a simple tool to pick materials in Material Replacer: https://bitbucket.org/thomthom/material-replacer/overview
You can use that as reference.
Advertisement