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):
Geodatabase.GetDefinition<AnnotationFeatureClassDefinition>("myAnnotation")
I can get the FeatureClassDefinition:
Geodatabase.GetDefinition<FeatureClassDefinition>("myAnnotation")
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?
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?
--Rich
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.