Refreshing ArcMap display using ArcPy?

The RefreshActiveView command should work for this, as far as I know. A quick few questions that might help troubleshoot:

Could you post a snippet of your .py in order to see which functions are running so we know what type of work is going on that is changing the values; this could have an effect on why it is not refreshing. Are you looking for the symbology to update due to the new values in the table?

ArcObjects could also be utilized in this scenario, but I prefer to not mix Objects and Python if possible because it has causes me a few issues in the past calling one from the other.


I've never run a cursor through arcpy in a running instance of ArcMap as you mention in the comment to MLowry's answer, but I would hazard a guess that if you simply want to refresh the display, you could perform an action using the mapping module. For instance, once creating a reference to the data frame in question, you could change the scale to a given value, which should trigger a redraw of whatever is in that active view (data frame). Alternatively, using the code to switch to Page Layout and back to Data View might also do the trick. It's hokey, but it might work for you.

Tags:

Arcpy

Arcmap