I want to access annotation layers using arcpy (the purpose is to verify few text strings in text annotations). By annotation I mean draw tool annotations, not dynamic labels. These annotation layers are under a groups layer by the name of 'Default'.
The Esri documentation talks of draw annotation as being layers themselves :
There are essentially three categories of layers in a map document: feature layers, group layers, and raster layers. The isFeatureLayer, isGroupLayer, and isRasterLayer properties allow you to identify or isolate the majority of layer types but not all layer types. There are a few specialized layers and datasets that don't fall into one of these three categories: annotation subclasses, dimension features, network datasets, terrain datasets, topology datasets, and so on. In these cases you may need to test other properties to isolate a layer of interest before doing something to it.
One thing to be aware of is how ArcGIS handles draw annotations, two mean configurations are possible :
ArcGIS fully supports two types of annotation: geodatabase and map document
In my case, it's map document.
In light of all this documentation, it so appears that draw annotations are mere layers, thus a simple code such as this should be working :
mxd = arcpy.mapping.MapDocument("some\mxdpath\here") df = arcpy.mapping.ListDataFrames(mxd,"Layers") lyr = arcpy.mapping.ListLayers(mxd,"current_annotation_layer",df)
But the problem is the annotations do not seem obtainable via dataframe (which is weird considering each of my annotation layers is associated to a feature layer).
Any specific arcpy class to access annotations (one comparable to IAnnotationFeature2 of ArcObject SDK)? Any workaround ?