My problem is that this tool works perfectly in IDLE or PyScripter programs, but if I use in the script in ArcGIS desktop this problem occurs: arcgisscripting.ExecuteError:ERROR 000582...
Why does it not execute in ArcGIS script but works in the programs?
The tool SelectLayerByAttribute management
is inside the arcpy.da.UpdateCursor
This is my code:
import arcpy
import datetime
arcpy.env.overwriteOutput = True
territory= arcpy.GetParameterAsText(0)
path= arcpy.GetParameterAsText(1)
territory_lyr= path+ "territorios_lyr"
arcpy.MakeFeatureLayer_management(territory,territory_lyr)
fields= ("FID", "avg_mindis", "I_conc", "Max_lenght","TamanoTerr")
with arcpy.da.UpdateCursor(territory, fields) as cursor:
for row in cursor:
currentID= row[0]
where= "FID="+str(currentID)
arcpy.SelectLayerByAttribute_management(territory_lyr, "NEW_SELECTION",where)
print
statements to see if you can identify which step is causing the error. I'd start by printing theterritory_lyr
variable to make sure the path is what you are expecting. – Jason Bellino Feb 19 '14 at 18:55