Passing instructions to active tools
-
**Hi,
I'm planning out a plugin that would allow the basic Sketchup drawing tools to be used with absolute coordinates. The idea is to be able to START a line (or other shape), at a given point in 3D space, which would be entered via the VCB. The functionality would be close to the drawing tools in AutoCAD. (It's a request from a architect friend of mine who has some specific use in mind).
Obviously Sketchup's tools don't respond to the VCB until you place the first point, and I know that it's not possible to extend the native Sketchup tools either. Is there some way of sending input points to an active tool via Ruby script instead? My idea was to set a ToolsObserver on the active model's tools object, collect some coordinates in the VCB, and as soon as a tool is activated, the observer callback function sends the previously entered input point to the tool as a starting point.
So far I haven't seen any way of passing instructions to a tool, is this even possible?
Thanks,
Sebastian.** -
You can not control the native tools via Ruby. But you can create your own Ruby tool which will accept VCB from the beginning - if you want.
http://www.sketchup.com/intl/en/developer/docs/ourdoc/tool -
I was afraid I'd have to do that...the base tools are not actually that simple, lots of state changes to keep track of. Anyway I'll start with LineTool.rb and go from there. Thanks Thom!
-
Yea, even the Line tool has a lot of details. I've been replicating Rotate and Move in Vertex Tools. So much more than I originally though.
Recently I started on a custom version of PushPull - it's giving me nightmares...
Advertisement