Program needs Messagebox to complete Scene Up Date
-
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
-
This is a known issue.
You have to approach it correctly / differently...
How are you setting up the page'sview.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 usingpage.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... -
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:
- 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.
- Use status = page.update(127) in place of Sketchup.send_action "pageUpdate:"
thanks
Keith
Advertisement