sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Does Sketchup has a threading mechanism

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 313 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      morci429
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        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 # if

        The ask_to_cancel() method would display a messagebox asking the user if they wish to cancel the calculation, and return true or false.

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • Dan RathbunD Offline
          Dan Rathbun
          last edited by

          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() }

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement