Using arcpy.Describe Method on Annotation layers

987
1
03-08-2013 08:52 AM
MikeMacRae
Occasional Contributor III
I'm testing layers in the current document using the
Describe
function. My code is:

for lyr in arcpy.mapping.ListLayers(df):
     if(lyr.isGroupLayer == False and lyr.isRasterLayer == False):
         x = arcpy.Describe(str(lyr))


It's throwing an error on the annotation layer:

"LSDSectionBoundaryAnno\Default" does not exist


I'm thinking that the Describe function doesn't like annotation layers or the subclasses? Can I use Describe on annotation layers and if not, how would I filter out annotation layers? There doesn't seem to be a 'isAnnotationLayer' property.

Thanks,
Mike
Tags (2)
0 Kudos
1 Reply
LucasDanzinger
Esri Frequent Contributor
Annotation feature classes can be described, but it is that default subclass that is messing you up. I would try something like this instead:

for lyr in arcpy.mapping.ListLayers(mxd):
    if lyr.isFeatureLayer:
        x = arcpy.Describe(lyr)


It talks about this in the third paragraph under the Discussion section in the Layer (arcpy.mapping) help page.