Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to run a arcscript to do batch work.

However, the error always showed that environment or tool not found. (gp.SplitByAttribute(inputFC, fieldName, outputWS, filePrefix) AttributeError: Object: Tool or environment not found)

Please kindly help with the following code.

Since any attachment is not allowed, please kindly advise if it is possible to send the arcscript somwhere. Thank you. System: ArcGIS 9.3 Windows Vista

##Script Name: split rows
##Description: using 
##Created By: Elaine Kuo
##Date: 23/09/2012


#Import standard library modules
 import arcgisscripting
 import os

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


#Set the workspace.
 gp.Workspace= "H:/temp/test1"


#Set the workspace. List all of the feature classes in the dataset
 outWorkspace= "H:/temp/test1"

 inputFC = "H:/temp/test1/geor0247_Dissolve.shp"
 fieldName = "C0247"
 outputWS = "H:/temp/test1"
 filePrefix = "geor0427"


 # Add a toolbox with a model to the geoprocessor and set the workspace
  gp.AddToolbox("C:/TEMP/AdditionalAnalysis/Additional Analysis - Generic Tools.tbx")



 #### Execute Script Tool ###
  gp.SplitByAttribute(inputFC, fieldName, outputWS, filePrefix)


  gp.AddMessage(gp.GetMessages())
  print gp.GetMessages()
share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.