<?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 arcpy symbology colors changing on RefreshActiveView() in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-symbology-colors-changing-on/m-p/716366#M55541</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a problem that I'm not sure is a acpy glitch or I'm just doing something wrong.&amp;nbsp; I'm using arcpy.mapping.UpdateLayer() to apply symbology to a layer, but afterwards some elements of the symbology needs to be removed depending on the attributes of the value field.&amp;nbsp; I've achived this programmatically, determining which symbology values need to be removed.&amp;nbsp; I'm using something similar to the following code to remove values from the symbology. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;lyr = arcpy.mapping.Layer(&amp;lt;layer name&amp;gt;)

a = lyr.symbology.classValues
b = lyr.symbology.classLabels

a = [u'1', u'2', u'3', u'4', u'5']
b = [u'Low', u'Moderate', u'High', u'Very High', u'Extreme']

a.remove('5')
b.remove('Extreme')

lyr.symbology.classValues = a
lyr.symbology.classLabels = b

arcpy.RefreshActiveView()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The method seems to work great.&amp;nbsp; The problem is the colors set by the symbology change after the arcpy.RefreshActiveView(), which defeats the whole purpose of applying symbology in the first place.&amp;nbsp; Is there a way to keep the colors the same after removing symbology values?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Oct 2013 00:28:12 GMT</pubDate>
    <dc:creator>MattEiben</dc:creator>
    <dc:date>2013-10-21T00:28:12Z</dc:date>
    <item>
      <title>arcpy symbology colors changing on RefreshActiveView()</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-symbology-colors-changing-on/m-p/716366#M55541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a problem that I'm not sure is a acpy glitch or I'm just doing something wrong.&amp;nbsp; I'm using arcpy.mapping.UpdateLayer() to apply symbology to a layer, but afterwards some elements of the symbology needs to be removed depending on the attributes of the value field.&amp;nbsp; I've achived this programmatically, determining which symbology values need to be removed.&amp;nbsp; I'm using something similar to the following code to remove values from the symbology. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;lyr = arcpy.mapping.Layer(&amp;lt;layer name&amp;gt;)

a = lyr.symbology.classValues
b = lyr.symbology.classLabels

a = [u'1', u'2', u'3', u'4', u'5']
b = [u'Low', u'Moderate', u'High', u'Very High', u'Extreme']

a.remove('5')
b.remove('Extreme')

lyr.symbology.classValues = a
lyr.symbology.classLabels = b

arcpy.RefreshActiveView()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The method seems to work great.&amp;nbsp; The problem is the colors set by the symbology change after the arcpy.RefreshActiveView(), which defeats the whole purpose of applying symbology in the first place.&amp;nbsp; Is there a way to keep the colors the same after removing symbology values?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 00:28:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-symbology-colors-changing-on/m-p/716366#M55541</guid>
      <dc:creator>MattEiben</dc:creator>
      <dc:date>2013-10-21T00:28:12Z</dc:date>
    </item>
  </channel>
</rss>

