sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Screen won't update

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

      I was putting together some methods to do some selections.

      The first was a method to select all connected planar faces. This worked fine.

      Then I modified that a little to a new method which selected all connected entities which had the same material as the selected face. The script correctly selects the entities, Entity Info confirms, but the viewport doesn't show the entities as selected. If I use the Move tool the view finally updates the selection, but not if I pan or rotate the view.

      I also tried to force refresh the view after the selection method is one by doing this:

      Sketchup.active_model.active_view.invalidate
      

      But that doesn't do anything either.

      If I add

      Sketchup.active_model.active_view.last_refresh_time 
      

      to before and after the selection loop the time is identical. Even with the force refresh code.

      What gives? (SU7 Pro + Vista Ultimate)

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

      1 Reply Last reply Reply Quote 0
      • T Offline
        todd burch
        last edited by

        To control the display refresh, you invalidate the view (as you show you tried), but you have to do that within the context of your class that is defined as Sketchup::Tool.

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

          So invalidating the view only works for Tools?

          Well, in any case, it's working now as I changed the way it looped through the entities. I was using .all_connected and that's when the oddity occurred. But I changed that because it didn't do what I wanted. I initially thought .all_connected returned the entities immediately connected, not the whole lot. I still don't understand why it happened though.

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

          1 Reply Last reply Reply Quote 0
          • T Offline
            todd burch
            last edited by

            Yes, view.invalidate is designed to work with Tools.

            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