""" University of Washington, Department of Geography Geography 465 Winter 2009 PYTHON EXAMPLES Author: Michalis Avraam SESSION: 7 Using Geoprocessor Tools: Clip """ # Import arcgisscripting import arcgisscripting # Invoke the geoprocessor gp = arcgisscripting.create(9.3) # Get a list of all feature classes fcList = gp.ListFeatureClasses() # Set the output workspace outWorkspace = "c:/Temp/results/" # Set the clip feature clipFeature = "c:/temp/uDistrict.shp" # Set the right Toolbox gp.Toolbox = "Analysis" # Loop through each feature class and create a buffer for fc in fcList: if (fc != clipFeature): gp.clip(fc, clipFeature, outWorkspace + fc)