JSheffield-esristaff

Batch Processing

Discussion created by JSheffield-esristaff Employee on Feb 27, 2011
Latest reply on Feb 27, 2011 by niklas.norrthonesri-se-esridist
I'm trying to batch process a series of feature classes.  I can get the series of feature classes and split them up into a list.  I need to pass the each feature class in the list into the second script/module along with the name of the feature class and the meadows fc (sys.argc[1]).  I'm having issues trying to figure out the best way to call the second script, any help or ideas would be appreciated. 

# Import system modules
import sys, string, os, arcgisscripting
#from decimal import *

# Create the Geoprocessor object
gp = arcgisscripting.create()
gp.Overwriteoutput = True

# Set the necessary product code
gp.SetProduct("ArcInfo")

# Load required toolboxes...
gp.AddToolbox("C:/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
gp.AddToolbox("C:/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx")

# Script arguments...
meadows = sys.argv[1]
Deer_1634_final = sys.argv[2]

Deer_List = Deer_1634_final.split(";")
#gp.AddMessage(str(Deer_List))

for featureclass in Deer_List:
 # gp.AddMessage("The current feature class is: " + str(featureclass))
 filename = str(featureclass)
 # gp.AddMessage("The name current feature class is: " + filename)
 
 #  Here I need to call the second python script/module
 #  And pass in the feautre class, the name of the feautre class, and meadows.
 

Outcomes