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

UI.start_timer() is the new while

Scheduled Pinned Locked Moved Developers' Forum
3 Posts 3 Posters 268 Views 3 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.
  • M Offline
    mtalbott
    last edited by 3 Nov 2011, 14:25

    One thought and one question...

    Thought: Now that in Sketchup 8 UI.start_timer() works with factions of a second, I've found it more stable, and more fun, to make any iterative loop with UI.start_timer. By doing this, you give control back to sketchup every cycle so you never get the white screen and the program never locks. Of course it is much slower, but by never locking up the program it even allows me to keep working while whatever script is running. My most current use is on a draping tool that approximates a complex topography with a simpler grid. It's fun to just watch it iterate over the surface and refine the points. Another simple example would be the "drop at intersection" tool. It is easily modified to refresh after each drop. It's sort of like a progress bar that you can see in the model. Just curious what peoples thoughts are on the technique. Before start_timer worked correctly I would do a similar thing with an animation class and next_frame.

    Question: In your experience, what is the smallest amount of pause time you can use with UI.start_timer to give sketch-up enough time to properly do it's thing and do you see a lower limit where there is no appreciable difference?

    -Mike

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 3 Nov 2011, 15:12

      Fredo is using timers for some of this plugins. He got some more experience.

      @mtalbott said:

      Question: In your experience, what is the smallest amount of pause time you can use with UI.start_timer to give sketch-up enough time to properly do it's thing and do you see a lower limit where there is no appreciable difference?

      That would depend on what you do within the timer block, would it not? And here you get an extra challenge, as you add more entities to a context, the more time it takes to create the next entity. So the time to takes to create geometry in SketchUp isn't constant.

      Is a timer of 0.0 interval not enough to return control?

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

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by 3 Nov 2011, 20:02

        I've experimented with using start_timer, and changing the time and/or partition size on the fly. It just gets far too slow to be worthwhile.

        http://forums.sketchucation.com/viewtopic.php?f=180&t=27092&p=234026#p234026

        Using an Animation class instead of a timer may be easier to code, but I'd guess the result would be similar.

        Hi

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

        Advertisement