sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Program needs Messagebox to complete Scene Up Date

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 246 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.
    • K Offline
      ktkoh
      last edited by

      I am working on code to automatically iterate thru the selected Components and Groups and make a Drawing Scene for each (an automated version of my Comp2LayerScene). However when I removed the last debug UI.messagebox the program only updates the last scene. All other scenes are there and the views have been created but never up dated so clicking on a scene except the last results in a blank view. If I zoom extents I can see the drawing views along with the main model view but not usable like this
      I tried a sleep(3) between each iteration however no change in results. Also the timer does not seem to be usable to solve this problem.

      The only thing that eliminates the problem is a UI.messagebox inside the loop. Not terrible but not what I had in mind.

      Keith

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

        This is a known issue.
        You have to approach it correctly / differently...
        How are you setting up the page's view.camera=the_new_camera for each scene?
        You should be able to set up a new scene [ page] using a view made with a suitably set up new camera.
        Are you using page.update with a suitable flag to save the changes with that scene [ page] ?
        Look at how http://sketchucation.com/pluginstore?pln=clf_extended_views does it...

        TIG

        1 Reply Last reply Reply Quote 0
        • K Offline
          ktkoh
          last edited by

          Thanks TIG after understanding what you were saying I found a solution.
          I discovered that if the view was set to Front View before the program started the pages all updated correctly without the UI.messagebox delay.
          By using code from Extended Standard Views, Chris Fullmer I was able to achieve automatic
          scene updates. I was not comfortable doing this so I compromised by adding the UI.messagebox to the first page only and then the rest of the pages updated correctly.

          To summarize:

          1. Use new_camera = new_camera.set eye, target, up Set to desired View or as I did use Sketchup.send_action "viewFront:"with a UI.messageboxto wait for the update.
          2. Use status = page.update(127) in place of Sketchup.send_action "pageUpdate:"

          thanks
          Keith

          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