@kaas said:
@miggy said:
...
I have a script that manipulates very many (20-30+) Google Earth terrain groups written back in SUv8...My script copies and explodes lots of groups & components. I do see a positive difference in V16 and opening / closing the outliner doesn't make any real difference.
Maybe your v8 code hasn't been optimized? You do make use of
model.start_operation("name of operation",true)?
the true flag here disables the UI which could make you code run faster. Just a thought.
Thanks so much kaas for getting me to re-examine my scripts. 
I have always used start_operation with disable_ui, but I have always believed that disable_ui didn't do anything useful - this because I have view.refresh in most of my loops!
Because the scripts are long-running, they would seem to be dead without view.refresh, especially because, most often, I also get the Windows 'not responding' in the title bar.
So, all said, a basic misunderstanding of view.refresh overriding disable_ui... 
To clarify this for myself, I've written a test script and a mini model to test against.
It has really cleared out any doubts or misunderstandings I have had.
If anybody is interested I have attached both script and test model.
Any further clarifications on my comments below are truly welcomed - sorry if any of them seem obvious to others, but these were grey areas for me...
Also, if anybody has found a way to get Ruby/Sketchup to 'talk' to Windows and tell it that "I am busy so please don't lock out my status bar and console", I am very interested.
I have tried using threads as well as Win32 calls to various PeekMessage, GetMessage, etc., but to no avail, so far, ... the only thing that works is UI.messagebox, but that is a useless solution for long running (20-40 minutes) analysis scripts...
The net clarifications, for me, that came out of this script revisit and testing are:
- The Layers window is never updated whilst a script is running - regardless of
start_operationor value ofdisable_ui. view.refreshoverridesdisable_ui.view.refreshis required if the model view-port needs to 'move' during processing.disable_uidoesdisable Outliner updates as well - good-bye attempts to automatically close it via script
- status bar and console are notaffected by
disable_ui - window 'not responding' doeslock status bar & console, but does not affect
view.refresh
