Select to view content in your preferred language

Move Annotation

1311
3
09-15-2010 06:08 PM
WesBailes
New Contributor III
Does anyone know how to move annotation through arcobjects?  I've tried a few different ways, but no results.  I can move the feature (box for text) but it doesn't move the text.  Thanks for any suggestions!  BTW I used the ITransform2d interface to move the polygon.
0 Kudos
3 Replies
AdamCrateau1
Occasional Contributor

Anyone else been able to successfully move annotation using arcobjects?  I'm trying to create an ArcMap add-in where geodatabase annotation can be selected and aligned with other features (annotation, lines, etc).  I'm running into the same issue as Wes - I can move the polygon but not the text.

0 Kudos
ChrisKushnir
Deactivated User

The easiest way is using IFeatureEdit.MoveSet(). 

Likewise for rotations, use IFeatureEdit.RotateSet().

The issue, as you've seen, is that the anno shape is just the bounding polygon.  This is true for both anno text and anno used to store graphics.  The actual text/graphic is stored in the element blob field.  So either use the *Set() methods, or move the polygon and element separately.

e.g.

var fedit = feature as IFeatureEdit;

var set = new SetClass();

set.Add(fedit);

var vector = new LineClass();

vector.FromPoint = ...;

vector.ToPoint = ...;

fedit.MoveSet(set, vector);

AdamCrateau1
Occasional Contributor

Excellent.  Thank you Chris, I'll give this a shot..

0 Kudos