Pick material under cursor
-
Hi all,
Is there a way to emulate material picker behavior?
I.e. is there a way to pick material from a scene via API?
Or at least invoke material picker via API?Thanks
Bro
-
You'd use the PickHelper class to pick an entity from the X, Y screen coordinate. Then get the material from the picked entity.
-
FYI, at the console:
ts = Sketchup.active_model.tools %(#004000)[#<Sketchup::Tools:0x999fd98>] ts.active_tool_name %(#004000)[PaintMatchTool] ts.active_tool_id %(#004000)[21255]
On the PC using the tool id does not seem to work (whilst it does for other native tools):
Sketchup.send_action( 21255 )
.. nor does a action string:
Sketchup.send_action "selectPaintMatchTool:"
?
Advertisement