Gather details of Annotation Subclass from ArcPro map.ListLayers() objects

07-02-2020 08:19 AM
New Contributor II

I am attempting to remove all Annotation Subclass layers from a list that is generated from a Map inside of ArcPro.
From what I can tell the subclasses must be a "Layer" inside of Pro.

I cannot find a method to conclusively distinguish which layers are annotation subclasses.

l = [list of Layer Objects]
for x in l:
if x:
desc = arcpy.Describe(x)
print (desc.featureClass.featuretype)
print (f"{x} cannot be described")

This will yield "Annotation" for both the Annotation layer, and its subclasses.

This will yield the Name of the Annotation layer for all subclasses

for x in l:
print x

generates an error **NameError: The attribute 'longName' is not supported on this instance of Layer** as soon as it hits the Annotation subclass

0 Kudos
0 Replies