Hi All, I want to move annotation feature to point feature (x,y) location in ArcObjects. I tried so many ways, but still my problem not solved, please help me.
IPoint shpPnt = ShpFeature.Shape as IPoint;
IAnnotationFeature pAnnoFeature = AnnoF as IAnnotationFeature;
IAnnotationElement pAnnoElement = pAnnoFeature.Annotation as IAnnotationElement;
IElement pelement = pAnnoElement as IElement;
ISymbolCollectionElement CollElement = pelement as ISymbolCollectionElement;
ITextElement pTextElement = pelement as ITextElement;
ITextSymbol pTextSym = pTextElement.Symbol;
ITransform2D T2d = pelement as ITransform2D;
T2d.Move(shpPnt.X, shpPnt.Y);
pAnnoFeature.Annotation = pelement;
IFeature MovedAnnoFeature = pAnnoFeature as IFeature;
AnnoF.Shape = MovedAnnoFeature.Shape;
MovedAnnoFeature.Store();
AnnoF.Store();
I think you have to set T2d to Element.Geometry = T2d.