[GIS] Getting from IFeatureClass on annotation feature class to IAnnoClass using ArcObjects

annotation;arcobjectsclassextensionscomtypespython

I am working in Python 2.6 and ArcGIS 10.0 through comtypes, so I have full ArcObjects access. For example, see the answer I tacked onto Accessing ArcObjects from Python?. That makes this strictly an object model traversal question.

I have an IFeatureClass on an annotation feature class. I need to get to IAnnoClass to get the ReferenceScale property.

How do I do that?

I am guessing that it starts with the Extension property inherited from IClass, but I may be way off base.

Best Answer

If a feature class is an annotation class, its IFeatureClass.Extension will be a reference to the AnnotationFeatureClassExtension coclass instance. It can be directly cast to IAnnoClass interface.

In short, you are right, the Extension property will be an object which implements IAnnoClass.

Related Question