AnsweredAssumed Answered

How to use IMoveTextFeedback.Start()?

Question asked by d.rothesri-ch-esridist Employee on Nov 7, 2018
Latest reply on Nov 16, 2018 by JCaccamo-esristaff

Hi,

 

Does anybody know how to use IMoveTextFeedback.Start() or can give me an example? I can't find any example or documentation in the internet. I get an exception in my code (see below).

 

Help is much appreciated. Thanks.

 

Kind Regards,
daniel

 

IFeature selectedFeature = GetSelectedFeature();
var annotationFeature = selectedFeature as IAnnotationFeature2;

if (selectedFeature != null && annotationFeature != null)
{
  IScreenDisplay screenDisplay = ArcMapUtils.GetAppScreenDisplay(MxApplication);

  ISymbol symbol = ((IEditAnnotationProperties) Editor).MultiWordSelectionSymbol;

  _moveTextFeedback = new MoveTextFeedbackClass();
  _moveTextFeedback.Display = screenDisplay;
  _moveTextFeedback.Symbol = symbol;

  const bool parallel = false;
  const double offset = 0;
  double referenceScale = MapUtils.GetReferenceScale(GetFocusMap());

  try
  {
    IPoint mapPoint = ToMapPoint(x, y);
    var polygon = (IPolygon)selectedFeature.Shape;
    IEnvelope envelope = polygon.Envelope;

    _moveTextFeedback.Start(polygon, envelope.Height, envelope.Width, referenceScale,
                            mapPoint, offset, parallel,
                            esriMoveTextConstraints.esriMoveTextConstraintsCursor);
  }
  catch (Exception exception)
  {
    _msg.Error("****", exception);
  }
}

Outcomes