Does Sketchup has a threading mechanism
-
I’m trying to do lots of calculation that takes long time. So far it’s working fine with a progress bar although as soon as i click on another window sketchup gets frozen until the calculation is finished and i have no idea whether it will continue or i should restart the program...
Any ideas? -
As long as you make sure your calculation routine does not get caught in an endless loop ... Windows will bring the Sketchup UI out of "ghost mode" when your routine finishes.
The Dynamic Component package has a built-in check that will ask the user if they wish to abandon DC updates if it is taking too long. You can do a similar thing.
@timeout = 30.0 # some number of secs the user sets. t = Time.now.to_f
Then each loop check:
if (Time.now.to_f - t) >= @timeout break if ask_to_cancel() end # ifThe ask_to_cancel() method would display a messagebox asking the user if they wish to cancel the calculation, and return true or false.
-
You could also try to see if using the UI.start_timer block method works for you.
This with execute the block immediately, and not repeat:
UI.start_timer(0.0,false) { my_calc_method() }
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