<?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: Update symbol ranges from layer file in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-symbol-ranges-from-layer-file/m-p/1143195#M7766</link>
    <description>&lt;P&gt;can you try doing a RecalculateRenderer(false)....(use "true" if you can have more than 100 unique values and want them all in the legend)&lt;/P&gt;</description>
    <pubDate>Fri, 11 Feb 2022 18:21:06 GMT</pubDate>
    <dc:creator>CharlesMacleod</dc:creator>
    <dc:date>2022-02-11T18:21:06Z</dc:date>
    <item>
      <title>Update symbol ranges from layer file</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-symbol-ranges-from-layer-file/m-p/1142904#M7760</link>
      <description>&lt;P&gt;I am applying symbology from a layer using the code snippet at &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-MapAuthoring#apply-symbology-to-a-layer-from-a-layer-file" target="_blank"&gt;https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-MapAuthoring#apply-symbology-to-a-layer-from-a-layer-file&lt;/A&gt;. When I use this method to update the symbology for a point layer, the symbols are updated but the symbol classes are maintained; the equivalent of 'maintain ranges' in the ApplySymbologyFromLayer tool. I would like for the symbol classes to be updated to only show the classes that are existent in the current data. Not all the classes from the symbology layer file. The equivalent of this in the ApplySymbologyFromLayer tool would be 'update ranges' and when I run this tool in Pro using 'update ranges', it does what I want.&lt;BR /&gt;So the question is how can I use the code below to update symbology ranges and not just maintain them?&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var lyrDocFromLyrxFile = new LayerDocument(layerFile);
var cimLyrDoc = lyrDocFromLyrxFile.GetCIMLayerDocument();
var rendererFromLayerFile = ((CIMFeatureLayer)cimLyrDoc.LayerDefinitions[0]).Renderer as CIMUniqueValueRenderer;
featureLayer?.SetRenderer(rendererFromLayerFile);&lt;/LI-CODE&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/145101"&gt;@CharlesMacleod&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/9021"&gt;@UmaHarano&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 23:31:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-symbol-ranges-from-layer-file/m-p/1142904#M7760</guid>
      <dc:creator>KisakyeM</dc:creator>
      <dc:date>2022-02-10T23:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Update symbol ranges from layer file</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-symbol-ranges-from-layer-file/m-p/1143195#M7766</link>
      <description>&lt;P&gt;can you try doing a RecalculateRenderer(false)....(use "true" if you can have more than 100 unique values and want them all in the legend)&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 18:21:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-symbol-ranges-from-layer-file/m-p/1143195#M7766</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2022-02-11T18:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Update symbol ranges from layer file</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-symbol-ranges-from-layer-file/m-p/1143208#M7767</link>
      <description>&lt;P&gt;When I do&amp;nbsp;&lt;SPAN&gt;RecalculateRenderer(false), it overwrites the point symbols retrieved from the layer file and replaces them with default point symbols which is not what I am looking to do.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 18:29:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-symbol-ranges-from-layer-file/m-p/1143208#M7767</guid>
      <dc:creator>KisakyeM</dc:creator>
      <dc:date>2022-02-11T18:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Update symbol ranges from layer file</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-symbol-ranges-from-layer-file/m-p/1143215#M7768</link>
      <description>&lt;P&gt;I see, then it would have to be done by hand then - as in, rebuild the renderer with the updated classes and current symbology. I can ask the mapping team if there is a way to extend Recalc renderer (or provide a new method) that can retain the current symbology.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 18:36:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-symbol-ranges-from-layer-file/m-p/1143215#M7768</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2022-02-11T18:36:44Z</dc:date>
    </item>
  </channel>
</rss>

