there is no such tool, you can check for yourself…
run this code >> activate PaintTool >> activate the eyedropper…
what_tool = UI.start_timer(2.0, true) do
tool = Sketchup.active_model.tools.active_tool_name
p "waiting for #{tool}"
end
# use the following to stop the timer or Quit SU
# UI.stop_timer(what_tool)
you will need to get the Material from a selected Sketchup::Drawingelement…
for v18 you can get the color at a pixel using Sketchup::ImageRep…
john
P.S: can you fix your Forum profile as you can’t be using SU Free for ruby…
I don’t think there’s a way to call that tool, via the API.
However, I suspect you’d like to continue working in your own tool anyway, and a .send_action() might well break out of it ?
Why not make your own Tool class… which temporarily sets a custom cursor to be the dropper icon, and then uses an onClick pick_helper to determine if the user has clicked on a face [or face within a container ?], and if so return that face.material.
You can then use that material in the main code as you desire…
I think I should have been more clear which tool I was talking about. It’s the one with the eye dropper icon in Materials tab on the right. Its tooltip is “Sample Paint”.
When I run the code you provided, I still get the same tool name. Here is a screenshot
Thank for your suggestion. I’ll probably go with that but I still wonder why I can’t activate an already implemented tool in SU and rather create my own with the same functionality.
Please also have a look at my reply to @john_drivenupthewall. Maybe it was also not clear for you which tool I was mentioning earlier.
I agree with TIG. I checked out the send_actions as well as using a MIcrosoft SDK tool to watch the UI and see if I could get the automation ID for that tool, but was unsuccessful.
Using the tool ID does not work.
You do know that you can get this tool anytime via shortcut B, then hold the ALT key ?