Pause Map refresh using python code

2491
7
11-01-2013 08:20 AM
EssamElhalhuli
New Contributor
I have script that I run from the python window in arcmap that creates intermediate feature classes that I then delete once the final feature class is created.
The problem is I cannot find a way to stop ArcMap plotting these intermediate feature classes and refreshing the map as each one is created.
Is there a way to pause the map update (using code) that I can incorporate in my script?
Tags (2)
0 Kudos
7 Replies
DouglasSands
Occasional Contributor II
Is there anything preventing you from running the script outside of ArcMap (eg as a tool in ArcCatalog by simply executing the python script)?
0 Kudos
EssamElhalhuli
New Contributor
Hi Doug,

The script uses the current map extent and CRS.
My end game hope is to make this an add-in as there are no other parameters required
0 Kudos
ChrisSnyder
Regular Contributor III
Is there a way to pause the map update (using code) that I can incorporate in my script?


Not a direct way to do this I think, but how just turning the layers off until the script is done executing? A related post: http://forums.arcgis.com/threads/94756-Use-Arcpy-to-Unselect-the-currently-selected-Features-in-all-...
0 Kudos
EssamElhalhuli
New Contributor
The best option I have found so far is to use arcgisscripting.

Using before the intermediate creations:
gp = arcgisscripting.create()
gp.AddOutputsToMap = False

Then before the final featureclass:
gp.AddOutputsToMap = True

Does the job, shame to have to resort to the old library
0 Kudos
DouglasSands
Occasional Contributor II
The best option I have found so far is to use arcgisscripting.

Using before the intermediate creations:
gp = arcgisscripting.create()
gp.AddOutputsToMap = False

Then before the final featureclass:
gp.AddOutputsToMap = True

Does the job, shame to have to resort to the old library


If you are in ArcMap and hit the pause button in the lower left corner, can you still run the tool?

... or ...

have you tried to change the environment setting?

arcpy.env.addOutputsToMap

- Russell
0 Kudos
EssamElhalhuli
New Contributor
If you are in ArcMap and hit the pause button in the lower left corner, can you still run the tool?

... or ...

have you tried to change the environment setting?

arcpy.env.addOutputsToMap

- Russell


arcpy.env.addOutputsToMap does the trick !!
Thanks for your help
0 Kudos
MattSayler
Occasional Contributor II
Just asked about this in a support ticket last week. There isn't currently a way to pause drawing using python. Someone has posted an Idea to add the functionality though, which I would encourage people to vote for: http://ideas.arcgis.com/ideaView?id=087E00000004bUpIAI
0 Kudos