I have an annotation feature. I can see its annotation classes when I drag-and-drop the feature from ArcCatalog to ArcMap. But I can't see the annotation classes when I add the annotation feature using ArcPy. I can't even see Annotation tab in the layer properties dialog. The layer doesn't look like Annotation at all (it looks like simple geometry feature), but Layer Properties>Source>Feature Type says the layer is "Annotation".
How can I add the annotation layer properly in Arcpy?
My environment: ArcGIS 10.1 / Windows XP 32 bit
My codes are:
Attachment 22088
The first layer is an annotation layer added by ArcPy and the second one is added using drag-and-drop from ArcCatalog.
Thanks,
Yongha
How can I add the annotation layer properly in Arcpy?
My environment: ArcGIS 10.1 / Windows XP 32 bit
My codes are:
Code:
import arcpy
my_mxd = arcpy.mapping.MapDocument("C:/PATH/TO/blank.mxd")
df = arcpy.mapping.ListDataFrames(my_mxd)[0]
anno_path = "C:/PATH/TO/some.gdb/BuildingAnno"
anno_layer= arcpy.mapping.Layer(anno_path)
arcpy.mapping.AddLayer(df,anno_layer)
my_mxd.saveACopy("C:/PATH/TO/saved.mxd")
The first layer is an annotation layer added by ArcPy and the second one is added using drag-and-drop from ArcCatalog.
Thanks,
Yongha