How to use IMoveTextFeedback.Start()?

467
2
11-07-2018 08:46 AM
DanielRoth
Esri Contributor

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("shit", exception);
  }
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
0 Kudos
2 Replies
JaredCaccamo
Esri Contributor

A bug, BUG-000105580, was logged for this in June 2017 which can be found here - The IMoveTextFeedback.Start(...) method throws an Automation Exception when initialized. It is currently in the product plan to be fixed but no date specified just yet. 

DanielRoth
Esri Contributor

Hi Jared

Thanks a lot for your answer. This was my first question in GeoNet and I never expected to get a reply on such a specific question. I really appreciate it.

I would expect this bug to be fixed in 10.6 since it’s reported a year ago.

Kind regards,

Daniel

++

Daniel Roth | Software Engineer

Esri Schweiz AG

Josefstrasse 218 | 8005 Zürich | Telefon +41 58 267 19 66

d.roth@esri.ch<mailto:d.roth@esri.ch> | esri.ch<https://www.esri.ch/>

THE SCIENCE OF WHERE

0 Kudos