Seems more complicated than I thought/hoped. I was hoping that there
was some possibility to re-use the code from the move-tool. Writing
this code from scratch doesn't thrill me at the moment. (By the way,
is the code of the standard SketchUp tools available?) I guess I'll
kep my tool as it is now...
Thanks anyway for the explanation Todd!
Happy Newyear!
On Dec 30, 3:20 pm, Todd Burch - Katy, Texas wrote:
You'll have to write a "Tool", using the tool class. Once your Tool
is activated by the user (model.select_tool) , you'll have access to
mouse events (Tool.onMouseMove). When your mouse is moved, you can do
a model.raytrace to see if the mouse is over a component, and if it
is, then you can automatically select it (model.selection.add).
Todd
On Dec 30, 6:26 am, dirkh wrote:
I have created some tools that act upon components. As it is, you have
to select a component, then invoke the tool (or you get the
UI.messagebox that says "No component selected").
When I compare to the built-in tools, they have a more intuïtive
behaviour. For instance, when you select the "Move" tool before
selecting anything, and you put the mouse over some component/line/
arc/..., then that component/line/arc/... is automatically
highlighted. (It even shows the little red crosses handles for the
rotation!).
How is this one? I would like to use it in one of my own tools.- Hide quoted
text -