<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcObjects (C#.Net) - How to copy and move Annotation Feature with ITransform2D? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-c-net-how-to-copy-and-move-annotation/m-p/352251#M9266</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This may solve the issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IFeature pNewAnnoFeature = pFeatureClass.CreateFeature();&lt;BR /&gt; if (CopyAttributes(pOldFeature, ref pNewAnnoFeature, out outErrMsg) == false)&lt;BR /&gt; {&lt;BR /&gt; MessageBox.Show(outErrMsg);&lt;BR /&gt; return;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; IClone pFirstAnnotation = (IClone)(pOldFeature as IAnnotationFeature).Annotation;&lt;BR /&gt; IElement pSecondElement = pFirstAnnotation.Clone() as IElement;&lt;BR /&gt; ITextElement pSecondTextElement = pSecondElement as ITextElement;&lt;BR /&gt; try&lt;BR /&gt; {&lt;BR /&gt; //ensure the alignment of the cloned text is lower left&lt;BR /&gt; ISymbolCollectionElement txtSymElemTwo = (ISymbolCollectionElement)pSecondTextElement;&lt;BR /&gt; txtSymElemTwo.HorizontalAlignment = esriTextHorizontalAlignment.esriTHALeft;&lt;BR /&gt; txtSymElemTwo.VerticalAlignment = esriTextVerticalAlignment.esriTVABottom;&lt;BR /&gt; }&lt;BR /&gt; catch (Exception ex)&lt;BR /&gt; {&lt;BR /&gt; MessageBox.Show(ex.ToString());&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITransform2D pTransform2D = (pSecondTextElement as ITransform2D);&lt;BR /&gt; pTransform2D.Move(100, 100);&lt;/P&gt;&lt;P&gt;(pNewAnnoFeature as IAnnotationFeature).Annotation = pSecondElement;&lt;BR /&gt; pNewAnnoFeature.Store();&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Jan 2020 05:09:12 GMT</pubDate>
    <dc:creator>MarkMindlin</dc:creator>
    <dc:date>2020-01-08T05:09:12Z</dc:date>
    <item>
      <title>ArcObjects (C#.Net) - How to copy and move Annotation Feature with ITransform2D?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-c-net-how-to-copy-and-move-annotation/m-p/352249#M9264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H1 style="background-color: #ffffff; border: 0px; font-weight: 200; font-size: 2rem;"&gt;&lt;SPAN style="font-size: 15px;"&gt;We need to copy an annotation feature (not feature linked) and move 10 metres.&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;Two issues:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 15px;"&gt;A new annotation is drawn behind old one&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN&gt;A new annotation&amp;nbsp;&lt;/SPAN&gt;is not moved&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;IFeatureClass pFeatCls = pSourceAnnotationFeature.Class as IFeatureClass;&lt;BR /&gt; IFeature pNewAnnoFeature = pFeatCls.CreateFeature();&lt;BR /&gt; CopyAttributes(&lt;SPAN&gt;pSourceAnnotationFeature&lt;/SPAN&gt;, ref pNewAnnoFeature);&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;IClone pCloneGeometry = (IClone)&lt;SPAN&gt;pSourceAnnotationFeature&lt;/SPAN&gt;.Shape;&lt;BR /&gt; IGeometry pShapeCopyGeometry = (IGeometry)pCloneGeometry.Clone();&lt;BR /&gt;ITransform2D pTransform2D = pShapeCopyGeometry as ITransform2D;&lt;BR /&gt; pTransform2D.Move( 10, 0);&lt;BR /&gt; pNewAnnoFeature.Shape = pShapeCopyGeometry;&lt;BR /&gt; (pNewAnnoFeature as IAnnotationFeature).Annotation.Geometry = pShapeCopyGeometry;&lt;BR /&gt; pNewAnnoFeature.Store();&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;ArcMap.Document.ActiveView.Refresh();&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2019 03:33:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-c-net-how-to-copy-and-move-annotation/m-p/352249#M9264</guid>
      <dc:creator>MarkMindlin</dc:creator>
      <dc:date>2019-08-16T03:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects (C#.Net) - How to copy and move Annotation Feature with ITransform2D?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-c-net-how-to-copy-and-move-annotation/m-p/352250#M9265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't spot anything immediately wrong with the code but what you could do is put a message box in to display the XY coordinate of say the centroid before and after the move and just before the store(). If they are what you expected then the issue is with the store step and is probably related to your data source. As the code is generic no one can tell if it is a shapefile or enterprise database such as arc server.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Aug 2019 12:45:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-c-net-how-to-copy-and-move-annotation/m-p/352250#M9265</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2019-08-22T12:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects (C#.Net) - How to copy and move Annotation Feature with ITransform2D?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-c-net-how-to-copy-and-move-annotation/m-p/352251#M9266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This may solve the issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IFeature pNewAnnoFeature = pFeatureClass.CreateFeature();&lt;BR /&gt; if (CopyAttributes(pOldFeature, ref pNewAnnoFeature, out outErrMsg) == false)&lt;BR /&gt; {&lt;BR /&gt; MessageBox.Show(outErrMsg);&lt;BR /&gt; return;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; IClone pFirstAnnotation = (IClone)(pOldFeature as IAnnotationFeature).Annotation;&lt;BR /&gt; IElement pSecondElement = pFirstAnnotation.Clone() as IElement;&lt;BR /&gt; ITextElement pSecondTextElement = pSecondElement as ITextElement;&lt;BR /&gt; try&lt;BR /&gt; {&lt;BR /&gt; //ensure the alignment of the cloned text is lower left&lt;BR /&gt; ISymbolCollectionElement txtSymElemTwo = (ISymbolCollectionElement)pSecondTextElement;&lt;BR /&gt; txtSymElemTwo.HorizontalAlignment = esriTextHorizontalAlignment.esriTHALeft;&lt;BR /&gt; txtSymElemTwo.VerticalAlignment = esriTextVerticalAlignment.esriTVABottom;&lt;BR /&gt; }&lt;BR /&gt; catch (Exception ex)&lt;BR /&gt; {&lt;BR /&gt; MessageBox.Show(ex.ToString());&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITransform2D pTransform2D = (pSecondTextElement as ITransform2D);&lt;BR /&gt; pTransform2D.Move(100, 100);&lt;/P&gt;&lt;P&gt;(pNewAnnoFeature as IAnnotationFeature).Annotation = pSecondElement;&lt;BR /&gt; pNewAnnoFeature.Store();&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2020 05:09:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-c-net-how-to-copy-and-move-annotation/m-p/352251#M9266</guid>
      <dc:creator>MarkMindlin</dc:creator>
      <dc:date>2020-01-08T05:09:12Z</dc:date>
    </item>
  </channel>
</rss>

