sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Update | Sketchucation Tools 5.0.8 released with licensing improvements and bugfixes Download

    UI doesn't update

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 4 Posters 589 Views 4 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.
    • G
      GWD
      last edited by

      In several of my scripts sometimes the UI doesn't update during a part of the script execution. In the beginning the UI update correctly after a while it doesn't update anymore but the script is still running. After a while the scripts ends and everything is back to normal and the script has done what it should do. But the script is much slower when the UI doesn't update! How can I avoid this problem?

      regards,

      Guy

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

        • If it's the various inspector dialogs such as Entity Info, Layers dialog, etc., you can call:

        UI.refresh_inspectors()

        • If it's the model client view you wish to refresh, you can call:

        Sketchup.active_model.active_view.refresh()

        I'm not here much anymore.

        1 Reply Last reply
        Reply Quote 0
        • thomthomT
          thomthom
          last edited by

          None of that will work - when a ruby script starts to do lots of work the UI will not update and not become responsive. There is no API methods that will avoid that.

          Under OSX that statusbar will still update, but under Windows it will not. In some of my heavy processing plugins, such as CleanUp, I do a Win32 API call to PeekMessage to make the UI update - but the user still won't be able to interact with it.

          It's a very annoying behaviour of SketchUp that's been a source of complaints for a long time. Many developers has tried to find ways around it, threads etc without any luck. Fredo got a system with timers, that somewhat prevents the window from completely turning unresponsive, but it cannot be applied to all tasks and it add to the total processing time.

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

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

            Sorry... I did not realize he was talking about "The curse of the Ghost Window"

            I'm not here much anymore.

            1 Reply Last reply
            Reply Quote 0
            • G
              GWD
              last edited by

              @thomthom said:

              None of that will work - when a ruby script starts to do lots of work the UI will not update and not become responsive. There is no API methods that will avoid that.

              Under OSX that statusbar will still update, but under Windows it will not. In some of my heavy processing plugins, such as CleanUp, I do a Win32 API call to PeekMessage to make the UI update - but the user still won't be able to interact with it.

              It's a very annoying behaviour of SketchUp that's been a source of complaints for a long time. Many developers has tried to find ways around it, threads etc without any luck. Fredo got a system with timers, that somewhat prevents the window from completely turning unresponsive, but it cannot be applied to all tasks and it add to the total processing time.

              Thanks thomthom, now i know it's a SU problem.

              1 Reply Last reply
              Reply Quote 0
              • nikusknxN
                nikusknx
                last edited by

                Update for Sketchup 2014 :

                
                require "Win32API.rb
                msg = "\000" * 36
                peekMessage = Win32API.new('user32','PeekMessage' , 'PLIII', 'I')
                peekMessage.call( msg, 0, 0, 0, 0x0000 ) != 0
                
                
                1 Reply Last reply
                Reply Quote 0

                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 Login
                • 1 / 1
                • First post
                  Last post
                Buy SketchPlus
                Buy SUbD
                Buy WrapR
                Buy eBook
                Buy Modelur
                Buy Vertex Tools
                Buy SketchCuisine
                Buy FormFonts

                Advertisement