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.
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 LoginAdvertisement