Skip to content

Instantly share code, notes, and snippets.

@cindygis
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cindygis/b8eaf35f1728f5dc5f3d to your computer and use it in GitHub Desktop.
Save cindygis/b8eaf35f1728f5dc5f3d to your computer and use it in GitHub Desktop.
Preventing intermediate geoprocessing results from being added to the data frame in ArcMap

When forced to run a script in the Python window in ArcMap, or when it's easier to do so, change the environmental setting to prevent the intermediate layers from being added to the TOC.

######arcpy.env.addOutputsToMap = False

Change it back to True when you want the result to be added e.g

arcpy.env.workspace = r"C:\Some\Arb\Folder\work.gdb"
arcpy.env.addOutputsToMap = False
ftr_list = [arcpy.management.MakeFeatureLayer(ftr) for ftr in arcpy.ListFeatureClasses()]
arcpy.env.addOutputsToMap = True
arcpy.management.Merge(ftr_list, "ftr_merge")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment