AnsweredAssumed Answered

ListLayers error

Question asked by progis99 on Feb 9, 2015
Latest reply on Feb 10, 2015 by progis99

I am having an syntax error from Pyscripter here and not sure why but I have a shapefile at the top of the TOC list which is the first and should be number zero  when writing a listlayers as a zero  but I still get the error .

 

The error is :

Traceback (most recent call last):

  File "C:\Student\python\GeoTIFF.py", line 16, in <module>

    gridlayer = arcpy.mapping.ListLayers(mxd,'JERGRIDINDEX', df,)[0]

IndexError: list index out of range

 

Take a look here the sytanx:: gridlayer = arcpy.mapping.ListLayers(mxd,'JERGRIDINDEX', df,)[0]

Outcomes