How to get the FeatureType of a FeatureClass

06-03-2020 05:40 AM
New Contributor

I am trying to programmatically get the FeatureType of a FeatureClass with the ArcGIS Pro SDK.

More precisely I would like to find out if the FeatureClass is of type Annotation.

I already tried opening the definition of type AnnotationFeatureClassDefinition.

This does not work (returns null):


I can get the FeatureClassDefinition: 


But how do I get the FeatureType? 

I am using ArcGIS.Core/ArcGIS.CoreHost in a standalone application.

Does anybody know how to do this?

0 Kudos
2 Replies
Esri Regular Contributor

If you're starting from a FeatureClass object, just try to cast it to an AnnotationFeatureClass:

FeatureClasss myFeatureClass;
if (myFeatureClass is AnnotationFeatureClass)
  AnnotationFeatureClass myAnnotationFeatureClass = myFeatureClass as AnnotationFeatureClass;

Is this what you are looking for?


0 Kudos
New Contributor

Thanks, Rich. I was testing with Annotation-FeatureClasses created with ArcGIS Desktop 10.5. 

I now have an Annotation-Featureclass created with ArcGIS Pro and I can either get the AnnotationClassDefinition directly or cast FeatureClass into AnnotationFeatureClass.

0 Kudos