Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a collection of rasters that I'm writing code to automate clipping based on a user defined shapefile. I am currently doing this in the Python window using the following as the main processing function:

arcpy.Clip_management( inputRasterFilename, "#", outputRasterFilename, "shapefile" )

Basically I want to read the raster, clip it, and have it saved to outputRasterFilename for later use.

This is exactly what happens except that ArcGIS also adds the result of clip operation to the current map that I have open. Is there a way to disable this?

share|improve this question
    
This post on ESRI's forums asks the equivalent question of a way to do this programmatically using Python. The OP seems to indicate this was available in 9.3 via arcgisscripting and now he wants to do it in 10.0 via arcpy. –  mindless.panda Jun 22 '11 at 16:53
    
This post on ESRI's forums gives a good workaround: always have the dialog disable and use the AddLayer function in the arcpy.mapping module to add outputs as needed. –  mindless.panda Jun 22 '11 at 17:04

3 Answers 3

up vote 8 down vote accepted

You can change this setting in the MXD by clicking Geoprocessing|Geoprocessing Options and unclicking "Add results of geoprocessing operations to the display".

share|improve this answer
    
Thanks! Is there a way to set this programmatically? –  mindless.panda Jun 21 '11 at 20:02
    
I know how to set it in .NET, but I don't know Python well enough yet for the correct syntax. –  kenbuja Jun 21 '11 at 20:05

Here is ESRI's documentation for doing it in .NET:

share|improve this answer
    
-1: This has nothing to do with what the OP requested since they're using arcpy. They don't have access to the IGeoProcessor namespace (or any other .Net namespace, for that matter). Furthermore, it's not really "documentation for doing it", it's a link to a method that allows or disallows adding outputs within ArcObjects. –  Michael Todd Jun 27 '11 at 21:40

With ArcGIS 10.1 it is possible to disable add output to the application display with arcpy.env.addOutputsToMap = False http://resources.arcgis.com/en/help/main/10.1/index.html#//018z0000004s000000

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.