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

    View.invalidate vs view.refresh

    Scheduled Pinned Locked Moved Developers' Forum
    8 Posts 4 Posters 328 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.
    • thomthomT Offline
      thomthom
      last edited by

      What is the difference?

      View.invalidate
      http://code.google.com/apis/sketchup/docs/ourdoc/view.html#invalidate

      @unknownuser said:

      The invalidate method is used to refresh the view.

      View.refresh
      http://code.google.com/apis/sketchup/docs/ourdoc/view.html#refresh

      @unknownuser said:

      The refresh method is used to immediately refresh the view.

      http://code.google.com/apis/sketchup/docs/releases.html

      @unknownuser said:

      Force refresh of a view. More powerful that view.invalidate because it refreshes immediately.

      I'm really none the wiser from these descriptions. 😞 ❓

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

      1 Reply Last reply Reply Quote 0
      • TIGT Online
        TIG Moderator
        last edited by

        Well, the first method is backwardly compatible, but the second one is a v7 onwards tool.
        I think that the first only updates the view outside of the start/commit block but the second updates the view straightaway - which could be useful if you want to show a user where they are up to - if you are inside a start/commit block with its 'flag' set 'true' [v7] the view isn't updated inside it...
        I avoid the second to keep v6+v7 compatibility as many haven't come over to the 'light-side' yet πŸ˜’

        TIG

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

          Yea - I try to keep to SU6 methods, but there are some of my plugins that require SU7+ methods with no way around it.

          Really wish there was a clear example for these two methods of refreshing...

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

          1 Reply Last reply Reply Quote 0
          • Chris FullmerC Offline
            Chris Fullmer
            last edited by

            Scott said that it will refresh the view even if there seems to be nothing to refresh, whereas invalidate will not....? But that never made sense to me entirely. I think it was put in place for dynamic components, but I'm not exactly sure why.

            Chris

            Lately you've been tan, suspicious for the winter.
            All my Plugins I've written

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

              Sounds like we might need to give Scott a prod...

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

              1 Reply Last reply Reply Quote 0
              • Chris FullmerC Offline
                Chris Fullmer
                last edited by

                I am thinking that maybe if you are moving geometry by increments, it will not show that movement with invalidate. BUT if you use refresh, then it will show it. In that sense, I think it is tied in with what TIG suggested about it working even inside a single start/commit call. So you can use it to anmiate the movement of geometry, without having to set up a true animation object.

                I probably should have tested that before I said it, but oh well. I'll go try to test it right now.

                Chris

                Lately you've been tan, suspicious for the winter.
                All my Plugins I've written

                1 Reply Last reply Reply Quote 0
                • M Offline
                  MartinRinehart
                  last edited by

                  @chris fullmer said:

                  I am thinking that maybe if you are moving geometry by increments, it will not show that movement with invalidate.

                  Airshow! is done with an invalidate() at the end of each frame's transformations.

                  Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                  1 Reply Last reply Reply Quote 0
                  • Chris FullmerC Offline
                    Chris Fullmer
                    last edited by

                    But that is done with an animation class, right? I was thinking maybe moving things that do not use the animation class would need it. But again, I'm probably wrong. I have not tried this, my computer has been tied up rendering artsy shadows for the seasonal changes over the course of a year.

                    Lately you've been tan, suspicious for the winter.
                    All my Plugins I've written

                    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