Hello,
I'm trying to go through layers in projects and I have an imported project from ArcMap with annotations and I'm trying to get the AnnotationFeature from AnnotationLayer that has AnnotationSubLayers, but i keep getting Feature object.
Does anyone have a valid code and data example?
Thank you!
Here is what I have and something is wrong:
//this finds 3 Annotations in view extent (I can see in GUI it has same TextString, different AnnotationClassId,SymbolID)
SpatialQueryFilter qf = new SpatialQueryFilter();
qf.FilterGeometry = viewExtentGeometry;
qf.SpatialRelationship = SpatialRelationship.Intersects;
...
if (_lyr is AnnotationLayer alr)
return ConsumeCursorAnnotation(alr.Search(qf));
...
/// this returns null when casted to AnnotationFeature
private IEnumerable<AnnotationFeature> ConsumeCursorAnnotation(RowCursor featureCursor)
{
while (featureCursor.MoveNext())
yield return featureCursor.Current as AnnotationFeature;
}
