<?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: Fail when updating ITextElement.Symbol in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/fail-when-updating-itextelement-symbol/m-p/606190#M16256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Answering this question so that it might be helpful for other users having similar question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The potential reason is that the annotation might be store in geodatabase and one should not control the display by ItextElement::Symbol property. Instead use &lt;SPAN style="color: #4d4d4d; text-indent: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal;"&gt;&lt;STRONG&gt;ISymbolCollectionElement&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px;"&gt;.&lt;/SPAN&gt; Below is the related documentation on this topic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001w000003vt000000" title="http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001w000003vt000000"&gt;ArcObjects Help for .NET developers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;---&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fresources.arcgis.com%2Fen%2Fhelp%2Farcobjects-net%2Fcomponenthelp%2Findex.html%23%2F%2F001w000003vt000000" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001w000003vt000000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;SPAN style="color: #4d4d4d; text-indent: 0px;"&gt;If you are editing Geodatabase Annotation,&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal;"&gt;&lt;STRONG&gt;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;DO NOT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px;"&gt;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;control the display of annotation features by obtaining a reference to the&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal;"&gt;&lt;STRONG&gt;TextSymbol&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px;"&gt;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;through&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal;"&gt;&lt;STRONG&gt;ITextElement::Symbol&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px;"&gt;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;and change the properties.&amp;nbsp; This will undermine the storage mechanism that Geodatabase Annotation utilizes for efficient storage.&amp;nbsp; For more information on&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal;"&gt;&lt;STRONG&gt;TextSymbols&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px;"&gt;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;and Geodatabase Annotation, see the interface&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal;"&gt;&lt;STRONG&gt;ISymbolCollectionElement&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px;"&gt;.&lt;/SPAN&gt;"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Sep 2015 16:06:53 GMT</pubDate>
    <dc:creator>ShriramBhutada1</dc:creator>
    <dc:date>2015-09-09T16:06:53Z</dc:date>
    <item>
      <title>Fail when updating ITextElement.Symbol</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/fail-when-updating-itextelement-symbol/m-p/606189#M16255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying to add halo effect to an annotation layer, when I was trying to updating the symbol properties of ITextElement, the following error prompted:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #608b4e;"&gt;System.Runtime.InteropServices.COMException (0x80004005): &lt;/SPAN&gt;
&lt;SPAN style="color: #608b4e;"&gt;Error HRESULT E_FAIL has been returned from a call to a COM component.&lt;/SPAN&gt;
&lt;SPAN style="color: #608b4e;"&gt;at ESRI.ArcGIS.Carto.ITextElement.set_Symbol(ITextSymbol Symbol&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no clue on what I've done wrong. Anyone can help me to find out what's the problem? any suggestion will be appreciated. &lt;SPAN aria-label="Happy" class="emoticon_happy emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;TextElement pTextElement = pAnnoFeat.Annotation as TextElement; ITextElement pElmt = pTextElement as ITextElement; ITextSymbol pTextSym = pElmt.Symbol;&amp;nbsp;&amp;nbsp; // simple line symbol ISimpleLineSymbol pLineSym = new SimpleLineSymbol(); pLineSym.Style = esriSimpleLineStyle.esriSLSNull;&amp;nbsp;&amp;nbsp; // Fill symbol&amp;nbsp; IFillSymbol pFillSymbol = new SimpleFillSymbol(); pFillSymbol.Outline = pLineSym; pFillSymbol.Color = Converter.ToRGBColor(Color.Blue);&amp;nbsp;&amp;nbsp; // IMask IMask pMask = pTextSym as IMask; pMask.MaskSize = 10; pMask.MaskStyle = esriMaskStyle.esriMSHalo; pMask.MaskSymbol = pFillSymbol;&amp;nbsp; pTextSym = pMask as ITextSymbol; pElmt.Symbol = pTextSym;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // &amp;lt;-- this is where error occurred pAnnoFeat.Annotation = pElmt as IElement;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:58:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/fail-when-updating-itextelement-symbol/m-p/606189#M16255</guid>
      <dc:creator>charlielam</dc:creator>
      <dc:date>2021-12-12T01:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Fail when updating ITextElement.Symbol</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/fail-when-updating-itextelement-symbol/m-p/606190#M16256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Answering this question so that it might be helpful for other users having similar question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The potential reason is that the annotation might be store in geodatabase and one should not control the display by ItextElement::Symbol property. Instead use &lt;SPAN style="color: #4d4d4d; text-indent: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal;"&gt;&lt;STRONG&gt;ISymbolCollectionElement&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px;"&gt;.&lt;/SPAN&gt; Below is the related documentation on this topic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001w000003vt000000" title="http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001w000003vt000000"&gt;ArcObjects Help for .NET developers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;---&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fresources.arcgis.com%2Fen%2Fhelp%2Farcobjects-net%2Fcomponenthelp%2Findex.html%23%2F%2F001w000003vt000000" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001w000003vt000000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;SPAN style="color: #4d4d4d; text-indent: 0px;"&gt;If you are editing Geodatabase Annotation,&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal;"&gt;&lt;STRONG&gt;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;DO NOT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px;"&gt;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;control the display of annotation features by obtaining a reference to the&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal;"&gt;&lt;STRONG&gt;TextSymbol&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px;"&gt;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;through&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal;"&gt;&lt;STRONG&gt;ITextElement::Symbol&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px;"&gt;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;and change the properties.&amp;nbsp; This will undermine the storage mechanism that Geodatabase Annotation utilizes for efficient storage.&amp;nbsp; For more information on&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal;"&gt;&lt;STRONG&gt;TextSymbols&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px;"&gt;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;and Geodatabase Annotation, see the interface&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal;"&gt;&lt;STRONG&gt;ISymbolCollectionElement&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; text-indent: 0px;"&gt;.&lt;/SPAN&gt;"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2015 16:06:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/fail-when-updating-itextelement-symbol/m-p/606190#M16256</guid>
      <dc:creator>ShriramBhutada1</dc:creator>
      <dc:date>2015-09-09T16:06:53Z</dc:date>
    </item>
  </channel>
</rss>

