Add Pause Drawing function to arcpy

1917
6
04-04-2013 08:03 AM
Status: In Product Plan
Labels (1)
JohnDye
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:

arcpy.PauseDrawing()

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.
6 Comments
TimBarnes
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)
AlekseyNaumov
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 (http://gis.stackexchange.com/questions/1644/how-to-disable-and-enable-drawing-in-arcmap-using-python) (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!
DuncanHornby

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.

HannesZiegler
Status changed to: Needs Clarification

The original idea was posted for ArcMap, which is now in maintenance and no longer receives new development. Today, ArcGIS Pro is the primary desktop application from ArcGIS. 

In ArcMap, processing blocked interaction with the UI. In ArcGIS Pro, this has been reworked so that you can continue working and geoprocessing tasks will be queued. Furthermore, Python Add-Ins are not supported in ArcGIS Pro.

DuncanHornby made a case for pause drawing in ArcGIS Pro for custom scripts/tools that cause map/status/data to refresh repeatedly during geoprocessing. 

Rather than closing the existing idea for ArcMap, we would like to reframe the idea for ArcGIS Pro and gather some more feedback from our users regarding the need/demand for a “pause drawing” feature in ArcPy for ArcGIS Pro (there will be no changes to the existing behavior in ArcMap). 

If interested in this idea being implemented for ArcGIS Pro, please reply with details on the following question:

  • What ArcGIS Pro workflows are affected by this issue? If possible, please supply narrow, concrete cases that we can investigate.
HannesZiegler
Status changed to: In Product Plan

Status update and good news! This feature is in the product plan. This status does not guarantee that the functionality will be in the next release, but development work has begun. Release cycles vary by product so make sure to check the product life cycle information to get an idea of when to expect the next release.  

DuncanHornby

That is indeed good news..