Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

problem with SelectLayerByAttribute management in script

$
0
0
hello 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 not executing in Arcgis script and the other progran yes?

the tool SelectLayerByAttribute management is inside the arcpy.da.UpdateCursor

this is my code:

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)


Viewing all articles
Browse latest Browse all 2485

Trending Articles