1

When converting a feature-linked multipart annotation to a singlepart in either the context menu within ArcMap, or with the ArcObjects interface I am left with an annotation that becomes stale.

The only way I can fix this is by moving the annotation a little bit, in this case its in follow feature mode. This also generally makes the rotation handles in the corners appear. It also populates the angle field in the annotation featureclass.

Converting to a singlepart annotation does work without error. The problem manifests when you try to edit a field such as "Angle" in the annotation featureclass. It always gives me the error "Invalid Angle". By default, upon conversion, the angle field will still say 0.

Is there some method within ArcObjects that will perform the same sort of action that moving an annotation does to "refresh" itself when converted to a singlepart?

Relevant Code snippet:

var annoFeature = feature as IAnnotationFeature2;
var element = annoFeature.Annotation;
((IMultiPartTextElement)element).ConvertToSinglePart();
feature.Store()
  • Did you try setting IAnnoClassAdmin3.UpdateOnShapeChange to true? – Kirk Kuykendall Aug 15 '18 at 20:18
  • Or perhaps just setting IFeature.Shape = IFeature.ShapeCopy then calling IFeature.Store() ... this might trigger the same thing that moving the feature does. – Kirk Kuykendall Aug 15 '18 at 20:21
  • I believe that applies to something else - to the "annotation class" itself. When that is set true (which it is in this case) it will adjust (usually move) the annotation with its feature-linked feature is modified. Unless I'm mistaken? – amasephy Aug 15 '18 at 20:26
  • Setting it to ShapeCopy does not work either. – amasephy Aug 15 '18 at 20:30
  • Hmm, after you ConvertTooSingle part, if you cast feature to IFeatureChanges, is ShapeChanged true? – Kirk Kuykendall Aug 15 '18 at 20:36
2

It looks like the problem revolved around the fact that despite after converting to a single part, the annotation still had a curved baseline. When converting to "straight", either through the context menu in ArcMap or in ArcObjects, it automatically corrects the issue.

For posterity, here is the snippet I created to mimic the convert to straight context menu functionality.

var pointCollection = (IPointCollection)element.Geometry;
IPolyline polyline = new PolylineClass();
polyline.FromPoint = pointCollection.Point[0];
polyline.ToPoint = pointCollection.Point[pointCollection.PointCount - 1];

Just set the symbol element geometry to the newly created polyline.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.