springsgirl

Expected Field not found or retrieved - Python SelectLayerByLocation

Discussion created by springsgirl on Nov 13, 2011
Latest reply on Nov 15, 2011 by jskinner-esristaff
Hello,
I'm trying to complete a select by layer on a layer I just made and keep getting an error code in PythonWin that "An expected Field was not found or could not be retrieved properly." It repeats this seveal times and references the dataset at as well in some of the lines and finishes with an error for SelectLayerbyLocation.  This is for a class I'm taking... I just can't seem to figure out what is causing this error code.

I'd appreciate any input or direction to reading materials to figure out what I'm doing wrong. Below is the errro code and I've attached my .py.
Thanks!!

>>> made feature
"NAME" ="North Central"
Traceback (most recent call last):
  File "C:\Python26\ArcGIS10.0\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 312, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\WCGIS\GEOG485\Lesson3\simplifiedstepback.py", line 29, in <module>
    arcpy.SelectLayerByLocation_management("GraffitiIncidentsLayer", "CONTAINED_BY", "CurrentPatrolZoneLayer")
  File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 4381, in SelectLayerByLocation
    raise e
ExecuteError: ERROR 999999: Error executing function.
An expected Field was not found or could not be retrieved properly.
An expected Field was not found or could not be retrieved properly. [PatrolZones]
An expected Field was not found or could not be retrieved properly.
An expected Field was not found or could not be retrieved properly. [PatrolZones]
Failed to execute (SelectLayerByLocation).

Attachments

Outcomes