Invoke draw(view) method on tool startup
-
Hi,
Is there a way to invoke the draw(view) method of a tool immediately on a tool startup?
When I start my tool I want to draw some lines on the screen. Although the tool initializes correctly, the draw method is not started. I need to zoom in\out or minimize\maximize SU window to get the draw method fire up.What am I doing wrong or what I am not doing which I should?
Tomasz -
It's and annoying limitation that
activate
doesn't have aview
argument.What I end up doing is:
def activate Sketchup.active_model.active_view.invalidate end
Some times, I've left it out, as my mouse move event continuously require the viewport to redraw.
-
As Thomthom said - at the start of the activate code invalidate the view - that's the same as zooming ?
-
Changing the viewport cause it to invalidate and trigger the
draw
events. -
@thomthom said:
What I end up doing is:
> def activate > Sketchup.active_model.active_view.invalidate > end >
Thanks. It has done the trick.
I've been tryingdef activate draw(Sketchup.active_model.active_view) end
, but it has not worked.
Advertisement