<?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 Alter a symbol in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/alter-a-symbol/m-p/1490411#M11657</link>
    <description>&lt;P&gt;I want to change the fill of polygons, when the user press a button. I am using this to get the render of the layer:&lt;/P&gt;&lt;P&gt;CIMSimpleRenderer currentRenderer = layer.GetRenderer() as CIMSimpleRenderer;&lt;/P&gt;&lt;P&gt;I am saving this render in a dict, to be able to change back later.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating this, I want to alter to change the color of the polygons:&lt;/P&gt;&lt;P&gt;CIMSimpleRenderer newRenderer = layer.GetRenderer() as CIMSimpleRenderer;&lt;/P&gt;&lt;P&gt;I am using this to make a new fill:&lt;/P&gt;&lt;P&gt;var fill = SymbolFactory.Instance.ConstructSolidFill(ColorFactory.Instance.CreateRGBColor(0, 0, 0));&lt;/P&gt;&lt;P&gt;How can I add the fill to the newRender?&lt;/P&gt;&lt;P&gt;For every polygon feature layer in TOC, I want to change the fill color, but retain the outline color.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2024 12:00:19 GMT</pubDate>
    <dc:creator>Daniel4</dc:creator>
    <dc:date>2024-06-12T12:00:19Z</dc:date>
    <item>
      <title>Alter a symbol</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/alter-a-symbol/m-p/1490411#M11657</link>
      <description>&lt;P&gt;I want to change the fill of polygons, when the user press a button. I am using this to get the render of the layer:&lt;/P&gt;&lt;P&gt;CIMSimpleRenderer currentRenderer = layer.GetRenderer() as CIMSimpleRenderer;&lt;/P&gt;&lt;P&gt;I am saving this render in a dict, to be able to change back later.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating this, I want to alter to change the color of the polygons:&lt;/P&gt;&lt;P&gt;CIMSimpleRenderer newRenderer = layer.GetRenderer() as CIMSimpleRenderer;&lt;/P&gt;&lt;P&gt;I am using this to make a new fill:&lt;/P&gt;&lt;P&gt;var fill = SymbolFactory.Instance.ConstructSolidFill(ColorFactory.Instance.CreateRGBColor(0, 0, 0));&lt;/P&gt;&lt;P&gt;How can I add the fill to the newRender?&lt;/P&gt;&lt;P&gt;For every polygon feature layer in TOC, I want to change the fill color, but retain the outline color.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 12:00:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/alter-a-symbol/m-p/1490411#M11657</guid>
      <dc:creator>Daniel4</dc:creator>
      <dc:date>2024-06-12T12:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Alter a symbol</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/alter-a-symbol/m-p/1490473#M11660</link>
      <description>&lt;P&gt;Symbols are made of layers. You can extract the symbol layers from your renderer's symbol and add the fill symbol to these layers. Here is a code snippet&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var renderer = lyr.GetRenderer() as CIMSimpleRenderer;
//Get the renderer's symbol and cast it to the type of symbol
var polygonSymbol = renderer.Symbol.Symbol as CIMPolygonSymbol;
//Get the layers in the symbol
var symbolLayer = polygonSymbol.SymbolLayers.ToList();
//Create a solid fill symbol layer
var fill = SymbolFactory.Instance.ConstructSolidFill(ColorFactory.Instance.RedRGB);
//Add the fill to the symbol layers
symbolLayer.Add(fill);
//Set the symbol layers back to the symbol
polygonSymbol.SymbolLayers = symbolLayer.ToArray();
//Set the symbol back to the renderer
renderer.Symbol.Symbol = polygonSymbol;
//Set the renderer back to the layer
lyr.SetRenderer(renderer);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can see the renderer's symbol layers in the UI Like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UmaHarano_0-1718198015100.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106817iF245BDCCD1349393/image-size/medium?v=v2&amp;amp;px=400" role="button" title="UmaHarano_0-1718198015100.png" alt="UmaHarano_0-1718198015100.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 13:15:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/alter-a-symbol/m-p/1490473#M11660</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2024-06-12T13:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Alter a symbol</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/alter-a-symbol/m-p/1491301#M11670</link>
      <description>&lt;P&gt;Hi Uma, thanks for your answer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added the new fill, and can see it like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Daniel4_0-1718264677512.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106938i6581D0900F0D0BE9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Daniel4_0-1718264677512.png" alt="Daniel4_0-1718264677512.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But is there a way, to turn off the visibility of the middle symbol layer?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 07:45:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/alter-a-symbol/m-p/1491301#M11670</guid>
      <dc:creator>Daniel4</dc:creator>
      <dc:date>2024-06-13T07:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Alter a symbol</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/alter-a-symbol/m-p/1491721#M11672</link>
      <description>&lt;P&gt;Since you have access to the SymbolLayers, you can manipulate any of these layers.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//Get the layers in the symbol
var symbolLayer = polygonSymbol.SymbolLayers.ToList();
//Can modify the layers in the symbol anyway you want.&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 13 Jun 2024 14:01:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/alter-a-symbol/m-p/1491721#M11672</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2024-06-13T14:01:05Z</dc:date>
    </item>
  </channel>
</rss>

