English

How To: Update the display while Avenue script is running

Procedure

How can the display be updated while an Avenue script is running?

Answer:

Avenue queues display requests and does not process them until there is a break in the script or until directed to.

Use the Flush request inside the script in order to update the display with all waiting drawing events. An example of how flush may be used follows:

'--- Reference the view object
theView = av.GetProject.FindDoc("View1")

'--- Add a draw event request to the draw event queue
theView.Invalidate

'--- Force the draw event queue to be processed before the next Avenue request
theView.GetDisplay.Flush

Notes:

Avenue maintains drawing requests in a queue until all scripts finish. This is necessary as some drawing requests may take several seconds and would slow script operations tremendously, if allowed to execute while a script is running.