Add Pause Drawing function to arcpy

04-04-2013 08:03 AM
Status: Open
Labels (1)
Regular Contributor
Arcpy already has a RefreshActiveView function to refresh the data frame after a change, but it would be helpful to be able to call a pause drawing function as well in order to greyout the map display for processes that are intensive to give the end user an intuitive way of knowing not to try and keep working while the process is running.

Case in point, I have a synchronization addin that syncs data on a shared drive with data on the users local computer in a one-way synchronization method (Parent to child). However, some of these datasets are quite large and as the data is reconciled, it is refreshed in the MXD. I do not want the user interacting with the MXD while syncrhonization is occuring.

Being able to call something like:


would be a very helpful way to prevent the user from interacting while this occurs. I suppose I could use the SendKeys module to send an F9 keystroke which would do the same thing, but then I have to package the SendKeys module with my addin and import it from the install folder.
A good idea. Working with the new pythonaddins within a ArcMap session, I also want to pause drawing while I do things (for example, creating a feature layer from pythonaddins.GetSelectedTOCLayerOrDataFrame adds that geometry to the map which is unwanted)
I would like to compliment this idea with an idea I had for modelbuilder, a tool that paused the display.
Sorry stuck in wrong hyperlink try again!
Excellent idea, would be very useful for speeding up geoprocessing. There is a suggested workaround of turning off all the layers and then reversing the operation at the end ( (note: I have not tried it), but it seems quite a bit of code to do something quite simple. I would really welcome something like arcpy.PauseDrawing(). Ideally, it should allow both graying out the map, or just not updating it. My script does a lot of spatial selection, so refreshing the map after each spatial selection really adds up to a significant slow-down!