<?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: Changing layer symbology in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407321#M32070</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think the problem, as pointed out by Cheffing in &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/91808-Setting-GraduatedSymbolsSymbology.classBreakValues-with-joined-fields-by-ArcPy"&gt;this&lt;/A&gt;&lt;SPAN&gt; thread, is that setting the symbology values does not work on layers with joined tables. &lt;/SPAN&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;lyr.symbology.classBreakValues = [1, 100, 250, 550]&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Without the join it works fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know of a workaround?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully ESRI can look into this problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Oct 2013 09:21:15 GMT</pubDate>
    <dc:creator>SimonS</dc:creator>
    <dc:date>2013-10-16T09:21:15Z</dc:date>
    <item>
      <title>Changing layer symbology</title>
      <link>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407315#M32064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I???m trying to change the class break values for a layer that has graduated colors symbology.&amp;nbsp; The layer has three data ranges and the classification method is natural breaks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code I???m trying to run:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy
from arcpy import env
mapdoc = arcpy.mapping.MapDocument(r"C:\data\Population.mxd")
df = arcpy.mapping.ListDataFrames(mapdoc, "layers")[0]
lyr = arcpy.mapping.ListLayers(mapdoc, "Population", df)[0]
lyrFile = arcpy.mapping.Layer(r"C:\data\update_layer.lyr")
arcpy.mapping.UpdateLayer(df, lyr, lyrFile, True)
lyr.symbology.classBreakValues = [1, 100, 250, 550]&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I run the script line-by-line in ArcMap???s Python window everything seems to work, up to and including the UpdateLayer line; the colors and data breaks change correctly and the layer still has natural breaks.&amp;nbsp; But running the last line gives me the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Runtime error 
Traceback (most recent call last):
&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;
&amp;nbsp; File "c:\program files\arcgis\desktop10.1\arcpy\arcpy\arcobjects\_base.py", line 87, in _set
&amp;nbsp;&amp;nbsp;&amp;nbsp; return setattr(self._arc_object, attr_name, cval(val))
RuntimeError&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At that point when I go to the symbology tab of the layer???s properties, there are three ranges but they are listed as 0-100, 0-250 and 0-550 and they have no symbols associated with them. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I start all over again and re-run everything and update the layer but instead try to change the number of classes with the line&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;lyr.symbology.numClasses = 4&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get the same error message as above.&amp;nbsp; When I try to access the layer???s properties a warning in ArcMap pops up:&amp;nbsp; ???Encountered an improper argument.???&amp;nbsp; If I click OK on the warning it lets me into the symbology tab but the dialog areas for all of the options under Quantities (Graduated colors, graduated symbols, etc) have the heading ???NO DESCRIPTION" and are otherwise blank.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This seems like a pretty straightforward script.&amp;nbsp; I can't figure out where the problem is.&amp;nbsp; I'm hoping someone can help me figure this out.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2013 13:21:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407315#M32064</guid>
      <dc:creator>SuzanneGriffith</dc:creator>
      <dc:date>2013-08-06T13:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Changing layer symbology</title>
      <link>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407316#M32065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Curious, why are you using UpdateLayer when you can directly change the classbreak values and descriptions directly.&amp;nbsp; Is it because the initial layer does not use the graduated symbols symbology?&amp;nbsp; Make sure the update layer also uses the right renderer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could it be possible that you are updating a layer with symbology from a layerfile that has classbreak information that doesn't match you underlying source data?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Before changing the classbreak values and descriptions, did you try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
lyr.symbology.reclassify()
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:31:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407316#M32065</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-12-11T18:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Changing layer symbology</title>
      <link>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407317#M32066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason I�??m doing it this way is because I want to specify the number of class breaks depending on the maximum value.&amp;nbsp; I also want specify the values of the class breaks and the colors used in the symbology.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this case, the original layer has four ranges.&amp;nbsp; The update layer is based the same data source and has three ranges.&amp;nbsp; Updating the layer changes the number of class breaks and gives me the colors I want.&amp;nbsp; But when I try to specify the maximum value shown in the legend I run into trouble.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I re-ran it with the reclassify line as you suggested but got the same error message when I then tried to update classBreakValues.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also re-ran it skipping the 6th and 7th lines to see if the problem is with the updating, but I get the same error.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Suzanne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Aug 2013 17:23:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407317#M32066</guid>
      <dc:creator>SuzanneGriffith</dc:creator>
      <dc:date>2013-08-07T17:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Changing layer symbology</title>
      <link>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407318#M32067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What do you get when you run:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
mapdoc = arcpy.mapping.MapDocument(r"C:\data\Population.mxd")
df = arcpy.mapping.ListDataFrames(mapdoc, "layers")[0]
lyr = arcpy.mapping.ListLayers(mapdoc, "Population", df)[0]
lyrFile = arcpy.mapping.Layer(r"C:\data\update_layer.lyr")
arcpy.mapping.UpdateLayer(df, lyr, lyrFile, True)
print lyr.symbologyType
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What does the print statement give you?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:31:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407318#M32067</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-12-11T18:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Changing layer symbology</title>
      <link>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407319#M32068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It says:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; print lyr.symbologyType
GRADUATED_COLORS&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:31:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407319#M32068</guid>
      <dc:creator>SuzanneGriffith</dc:creator>
      <dc:date>2021-12-11T18:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Changing layer symbology</title>
      <link>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407320#M32069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just following up to see if you have any additional advice.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Suzanne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 12:57:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407320#M32069</guid>
      <dc:creator>SuzanneGriffith</dc:creator>
      <dc:date>2013-08-26T12:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Changing layer symbology</title>
      <link>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407321#M32070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think the problem, as pointed out by Cheffing in &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/91808-Setting-GraduatedSymbolsSymbology.classBreakValues-with-joined-fields-by-ArcPy"&gt;this&lt;/A&gt;&lt;SPAN&gt; thread, is that setting the symbology values does not work on layers with joined tables. &lt;/SPAN&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;lyr.symbology.classBreakValues = [1, 100, 250, 550]&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Without the join it works fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know of a workaround?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully ESRI can look into this problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Oct 2013 09:21:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/changing-layer-symbology/m-p/407321#M32070</guid>
      <dc:creator>SimonS</dc:creator>
      <dc:date>2013-10-16T09:21:15Z</dc:date>
    </item>
  </channel>
</rss>

