Scratch workspace (Environment setting)

Tools that honor the Scratch Workspace environment setting use the specified location as the default workspace for output datasets. The Scratch Workspace is intended for output data you do not wish to maintain.

The primary purpose for the Scratch Workspace environment is for use by ModelBuilder. ModelBuilder needs a workspace to write intermediate datasets—datasets that are of no use once a model is run. Although its primary purpose is for ModelBuilder, there may be times when you want to set it for tool dialog boxes.

Learn more about using the current and scratch workspace environments.

Usage notes

Dialog syntax

Scripting syntax

arcpy.env.scratchWorkspace = path

Parameter

Explanation

path

The default location for geoprocessing tool input and output.

scratchWorkspace syntax

Script example

import arcpy

# Set the scratchWorkspace environment to local file geodatabase
arcpy.env.scratchWorkspace = "c:/data/scratchoutput.gdb"

Related Topics

3/3/2014