sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Keeping control over very long tasks

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 700 Views 2 Watching
    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.
    • fredo6F Offline
      fredo6
      last edited by

      Hi to all,

      I was wondering if there was a way to give back control to the Tool message loop when performing a long calculations.

      To be clearer let's assume you have a piece of code that may take a long while to process. Assuming it is executed in the context of a Tool, it seems that you cannot catch any event while it is processed (such as getting a key or click down). This may be because Sketchup is monothreaded.

      I tried to call iteratively each piece of processing in a Start_timer call, but this does not work (in addition the usage of Ruby continuation, callcc, does crash the program).
      If you start a seaparet thread, it does not work either (it seems that Skecthup API cannot eb executed ina separated thread).

      If anyone has an idea, that would be helpful. It is a pity that Sketchup does not have a method for that!

      Thanks

      Fredo

      1 Reply Last reply Reply Quote 0
      • AdamBA Offline
        AdamB
        last edited by

        I've had no success either. I guess its because if you look at how its recommended to embed Ruby in an App, its a very simple ruby_run() model. So SU may be multi-threaded or not, but the call to Ruby is a busy wait.

        Pretty much the only thing that does work is spawn a Ruby thread that twiddles the Sketchup.set_status_text

        😞

        Adam

        Developer of LightUp Click for website

        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