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
activatedoesn't have aviewargument.What I end up doing is:
def activate Sketchup.active_model.active_view.invalidate endSome 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
drawevents. -
@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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement