Script environments |
|
|
Release 9.3
Last modified December 18, 2008 |
Print all topics in : "Geoprocessing environments" |
Environments in script tools behave like environments in any other tool; environment values are passed down to the script where they are applied to tools run within the script. You can set environments within a script, thereby overriding any passed-down environments. Environment values set within scripts only apply to the execution of the script; passed-down environment values are not altered. In the following sample script, the current workspace value is overridden in the script.
import sys, string, os, arcgisscripting
gp = arcgisscripting.create()
# Print the passed-down current workspace environment setting
#
gp.AddMessage("The passed-down current workspace is: %s" % gp.Workspace)
# Set a new workspace, overriding the passed-down workspace
#
gp.Workspace = "e:\data\script.gdb"
gp.AddMessage("The new current workspace is: %s" % gp.Workspace)