Add Pause Drawing function to arcpy

04-04-2013 08:03 AM
Status: Open
Labels (1)
Occasional Contributor III
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)
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!

Want to bump this idea up the list. I find many ArcPro tools cause some kind of event that causes the map/status bars to fresh all the time. If your script is geo-processor heavy you can get significant drops in performance as the map is trying to update all the time.  A good example is when you have some sort of iterative selection driving the geo-processing. It would be good if we had some sort of function that causes the map to go into pause display mode.