How to Move Annotation Feature to point feature (x,y) location in ArcObjects (C#.Net)

782
1
06-07-2018 09:27 PM
SatyanarayanaChallaboyana
New Contributor II

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();

0 Kudos
1 Reply
M_DJohnson
Occasional Contributor

I think you have to set T2d to Element.Geometry = T2d. 

0 Kudos