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 <SPAN class="operator token">=</SPAN> <SPAN class="token function">GetSelectedFeature</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> annotationFeature <SPAN class="operator token">=</SPAN> selectedFeature <SPAN class="keyword token">as</SPAN> IAnnotationFeature2<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>selectedFeature <SPAN class="operator token">!=</SPAN> <SPAN class="keyword token">null</SPAN> <SPAN class="operator token">&&</SPAN> annotationFeature <SPAN class="operator token">!=</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
IScreenDisplay screenDisplay <SPAN class="operator token">=</SPAN> ArcMapUtils<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetAppScreenDisplay</SPAN><SPAN class="punctuation token">(</SPAN>MxApplication<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
ISymbol symbol <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">(</SPAN>IEditAnnotationProperties<SPAN class="punctuation token">)</SPAN> Editor<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>MultiWordSelectionSymbol<SPAN class="punctuation token">;</SPAN>
_moveTextFeedback <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">MoveTextFeedbackClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
_moveTextFeedback<SPAN class="punctuation token">.</SPAN>Display <SPAN class="operator token">=</SPAN> screenDisplay<SPAN class="punctuation token">;</SPAN>
_moveTextFeedback<SPAN class="punctuation token">.</SPAN>Symbol <SPAN class="operator token">=</SPAN> symbol<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">const</SPAN> <SPAN class="keyword token">bool</SPAN> parallel <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">const</SPAN> <SPAN class="keyword token">double</SPAN> offset <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">double</SPAN> referenceScale <SPAN class="operator token">=</SPAN> MapUtils<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetReferenceScale</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="token function">GetFocusMap</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">try</SPAN>
<SPAN class="punctuation token">{</SPAN>
IPoint mapPoint <SPAN class="operator token">=</SPAN> <SPAN class="token function">ToMapPoint</SPAN><SPAN class="punctuation token">(</SPAN>x<SPAN class="punctuation token">,</SPAN> y<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> polygon <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>IPolygon<SPAN class="punctuation token">)</SPAN>selectedFeature<SPAN class="punctuation token">.</SPAN>Shape<SPAN class="punctuation token">;</SPAN>
IEnvelope envelope <SPAN class="operator token">=</SPAN> polygon<SPAN class="punctuation token">.</SPAN>Envelope<SPAN class="punctuation token">;</SPAN>
_moveTextFeedback<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Start</SPAN><SPAN class="punctuation token">(</SPAN>polygon<SPAN class="punctuation token">,</SPAN> envelope<SPAN class="punctuation token">.</SPAN>Height<SPAN class="punctuation token">,</SPAN> envelope<SPAN class="punctuation token">.</SPAN>Width<SPAN class="punctuation token">,</SPAN> referenceScale<SPAN class="punctuation token">,</SPAN>
mapPoint<SPAN class="punctuation token">,</SPAN> offset<SPAN class="punctuation token">,</SPAN> parallel<SPAN class="punctuation token">,</SPAN>
esriMoveTextConstraints<SPAN class="punctuation token">.</SPAN>esriMoveTextConstraintsCursor<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">catch</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="token class-name">Exception</SPAN> exception<SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
_msg<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Error</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"shit"</SPAN><SPAN class="punctuation token">,</SPAN> exception<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>