What use are Tool id's?
-
Is there any way to get a Ruby reference to a Tool identified by an id number returned from Tools.get_active_tool? For instance, model.select_tool wants a reference to a Tool, not an id. So, what can you do with a Tool id except display it for curiosity sake?
Cursors are also identified by id numbers, but these numbers are what you pass to UI.set_cursor. Why not tools?
-
Did you see my proposal in the SKX sub-forum ?
[Code] (beta) Sketchup::Tools helper methods
It would be nice if some similar functionality was rolled into the API.
-
Also
Sketchup::Model#select_tool()
only takes a RubyTool instance.It does not accept native tool arguments in any form. That includes ids or tool names.
One main issue we have had is that SketchUp's native tools are not exposed as a Ruby object.
Another is that annoyingly the model'sSketchup::Tools
collection is unaware of the specifics of a current Ruby tool, returning "RubyTool" as the name.Also although the API does not say so... a Ruby Tool eventually gets an integer command id assigned when it's menu item is created via
Sketchup::Menu#add_item()
-
@slbaumgartner said:
So, what can you do with a Tool id except display it for curiosity sake?
ON the PC they are actually the command IDs, so you can pass them as an argument to
Sketchup::send_action()
-
@dan rathbun said:
@slbaumgartner said:
So, what can you do with a Tool id except display it for curiosity sake?
ON the PC they are actually the command IDs, so you can pass them as an argument to
Sketchup::send_action()
Thanks for all the info, Dan. Can I take it from this comment that this technique does not work on Mac?
steve
-
Last I knew Mac only worked with string arguments for actions.
Advertisement