<?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: How to change the fill color for a GraphicElement in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-change-the-fill-color-for-a-graphicelement/m-p/1505161#M11868</link>
    <description>&lt;P&gt;Change the color on the &lt;EM&gt;symbol&lt;/EM&gt;, not the fill.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if (symbol is CIMPolygonSymbol polygonSymbol)
   polygonSymbol.SetColor(....)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To change the color on a fill, use its color property.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var solidFill = polygonSymbol.SymbolLayers.OfType&amp;lt;CIMSolidFill&amp;gt;().FirstOrDefault();
     solidFill?.Color = .... ;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Symbol" take a symbol reference not a symbol. An unfortunate property naming.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//polygonGraphic.Symbol = symbol;
polygonGraphic.Symbol = symbol.MakeSymbolReference();&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 13 Jul 2024 20:21:22 GMT</pubDate>
    <dc:creator>CharlesMacleod</dc:creator>
    <dc:date>2024-07-13T20:21:22Z</dc:date>
    <item>
      <title>How to change the fill color for a GraphicElement</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-change-the-fill-color-for-a-graphicelement/m-p/1504841#M11862</link>
      <description>&lt;P&gt;There is&amp;nbsp;GetGraphic() method and&amp;nbsp;GetGraphic().Symbol for the GraphicElement, but how to change the fill color?&lt;/P&gt;&lt;P&gt;This is a graphicelement drawn on a graphicslayer using the Graphics tab on the ArcPro UI...&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 15:20:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-change-the-fill-color-for-a-graphicelement/m-p/1504841#M11862</guid>
      <dc:creator>Gurunara</dc:creator>
      <dc:date>2024-07-12T15:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the fill color for a GraphicElement</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-change-the-fill-color-for-a-graphicelement/m-p/1504902#M11864</link>
      <description>&lt;P&gt;CIMSymbol SetColor :&amp;nbsp;&lt;A href="https://prodev.arcgis.com/en/pro-app/latest/sdk/api-reference/topic16566.html" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic16566.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;CIMPolygonSymbol SetOutlineColor :&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic16567.html" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic16567.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 16:41:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-change-the-fill-color-for-a-graphicelement/m-p/1504902#M11864</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2024-07-12T16:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the fill color for a GraphicElement</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-change-the-fill-color-for-a-graphicelement/m-p/1504922#M11865</link>
      <description>&lt;P&gt;&lt;A href="https://prodev.arcgis.com/en/pro-app/latest/sdk/api-reference/topic16566.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic16566.html&lt;/A&gt;&amp;nbsp;is invalid link...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have following: but&amp;nbsp;&lt;/P&gt;&lt;P&gt;CIMPolygonGraphic polygonGraphic = aoi.GetGraphic() as CIMPolygonGraphic;&lt;/P&gt;&lt;P&gt;// Access the symbol of the polygon graphic&lt;BR /&gt;var symbol = polygonGraphic.Symbol;&lt;/P&gt;&lt;P&gt;// Change the fill color of the symbol using SetColor&lt;BR /&gt;if (symbol is CIMPolygonSymbol polygonSymbol)&lt;BR /&gt;{&lt;BR /&gt;var solidFill = polygonSymbol.SymbolLayers.OfType&amp;lt;CIMSolidFill&amp;gt;().FirstOrDefault();&lt;BR /&gt;if (solidFill != null)&lt;BR /&gt;{&lt;BR /&gt;solidFill.SetColor(ColorFactory.Instance.RedRGB);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Update the symbol in the graphic&lt;BR /&gt;polygonGraphic.Symbol = symbol;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gives following errors:&lt;BR /&gt;&lt;BR /&gt;Severity Code Description Project File Line Suppression State&lt;BR /&gt;Error CS8121 An expression of type 'CIMSymbolReference' cannot be handled by a pattern of type 'CIMPolygonSymbol'. EGIS.Core.Pro.Common C:\Users\EMSMP\Desktop\desktemp\repos\egis-Core-Pro-Common\Common\Data\MapProjectService.cs 185 Active&lt;BR /&gt;&lt;BR /&gt;Severity Code Description Project File Line Suppression State&lt;BR /&gt;Error CS1929 'CIMSolidFill' does not contain a definition for 'SetColor' and the best extension method overload 'SymbolExtensionMethods.SetColor(CIMSymbol, CIMColor)' requires a receiver of type 'ArcGIS.Core.CIM.CIMSymbol' EGIS.Core.Pro.Common C:\Users\EMSMP\Desktop\desktemp\repos\egis-Core-Pro-Common\Common\Data\MapProjectService.cs 190 Active&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 17:08:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-change-the-fill-color-for-a-graphicelement/m-p/1504922#M11865</guid>
      <dc:creator>Gurunara</dc:creator>
      <dc:date>2024-07-12T17:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the fill color for a GraphicElement</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-change-the-fill-color-for-a-graphicelement/m-p/1505161#M11868</link>
      <description>&lt;P&gt;Change the color on the &lt;EM&gt;symbol&lt;/EM&gt;, not the fill.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if (symbol is CIMPolygonSymbol polygonSymbol)
   polygonSymbol.SetColor(....)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To change the color on a fill, use its color property.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var solidFill = polygonSymbol.SymbolLayers.OfType&amp;lt;CIMSolidFill&amp;gt;().FirstOrDefault();
     solidFill?.Color = .... ;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Symbol" take a symbol reference not a symbol. An unfortunate property naming.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//polygonGraphic.Symbol = symbol;
polygonGraphic.Symbol = symbol.MakeSymbolReference();&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 13 Jul 2024 20:21:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-change-the-fill-color-for-a-graphicelement/m-p/1505161#M11868</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2024-07-13T20:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the fill color for a GraphicElement</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-change-the-fill-color-for-a-graphicelement/m-p/1514181#M11931</link>
      <description>&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-sdk-questions/trying-to-change-the-fill-color-of-a/m-p/1514160#M11930" target="_blank"&gt;https://community.esri.com/t5/arcgis-pro-sdk-questions/trying-to-change-the-fill-color-of-a/m-p/1514160#M11930&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 13:58:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-change-the-fill-color-for-a-graphicelement/m-p/1514181#M11931</guid>
      <dc:creator>Gurunara</dc:creator>
      <dc:date>2024-08-02T13:58:33Z</dc:date>
    </item>
  </channel>
</rss>

