Solved! Go to Solution.
##Script Name: Make a line from points ##Description: Connect the line by points using XToools Pro ##Created By: Elaine Kuo ##Date: 03/05/2012 #Import standard library modules import arcgisscripting import os #Create the Geoprocessor object gp = arcgisscripting.create(9.3) #Set the input workspace #GP.workspace = sys.argv[1] #Set the workspace. gp.Workspace= "H:/temp/test" #Set the output workspace #outWorkspace = sys.argv[2] #Set the workspace. List all of the feature classes in the dataset outWorkspace= "H:/temp" #Get a list of the featureclasses in the input folder fcs = gp.ListFeatureClasses() # Loop through every item in the list that was just generated for fc in fcs: # Break out the name, no path or extension, using the describe object. desc = gp.describe(fc) featureName = desc.name #Validate the new feature class name for the output workspace. gp.Toolbox = "Data Management" # Add a field to this shapefile gp.addfield (fc, "min", "double", 6,3) # Loop through every item in the list that was just generated gp.toolbox = "Data Management" expression = "!min!" gp.CalculateField_management(fc, "min", expression, "PYTHON") #Validate the new feature class name for the output workspace. OutFeatureClass = outWorkspace + os.sep + gp.ValidateTableName(fc,outWorkspace) gp.AddMessage(gp.GetMessages()) print gp.GetMessages()