<?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 Can I fix this runtime error from addAllValues()? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-can-i-fix-this-runtime-error-from-addallvalues/m-p/1249116#M66588</link>
    <description>&lt;P&gt;Add some print statements before the hab_lyr.symbology.addAllValues() so you know which layer is causing that error.&amp;nbsp; I tried it on a couple of my datasets and it didn't throw that error so you'll have to do some more debugging to narrow the issue down.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;print 'changing: {}'.format(hab_lyr.name)&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 18 Jan 2023 16:34:09 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2023-01-18T16:34:09Z</dc:date>
    <item>
      <title>How Can I fix this runtime error from addAllValues()?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-fix-this-runtime-error-from-addallvalues/m-p/1248112#M66539</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having trouble adding all values to layers symbology. If I use 'addAllValues()' by itself on one layer it works fine. However, when I create a list and do this en masse I get the following error:&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Traceback (most recent call last):
  File "\\PDCCITRDSGIS02\Projects_3\PGE\00129_21_Kleinfelder_VegManagement\Tools\Scripts\Make_Figure2_experimental.py", line 77, in &amp;lt;module&amp;gt;
    hab_lyr.symbology.addAllValues()
  File "C:\Program Files (x86)\ArcGIS\Desktop10.8\ArcPy\arcpy\_mapping.py", line 1387, in addAllValues
    return convertArcObjectToPythonObject(self._arc_object.addAllValues(*gp_fixargs((), True)))
RuntimeError&lt;/LI-CODE&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;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An excerpt of my code is below. It is strange, because in my full code, I set a def query on hab_lyr with no problem.&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;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;        for lyr in layers_list:
            print "Updating Work Area and Buffer Data Sources..."
            hab_lyr = arcpy.mapping.ListLayers(mxd, lyr)[0]
            if hab_lyr.symbologyType == "UNIQUE_VALUES":
                hab_lyr.symbology.addAllValues()&lt;/LI-CODE&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;&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>Fri, 13 Jan 2023 16:46:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-fix-this-runtime-error-from-addallvalues/m-p/1248112#M66539</guid>
      <dc:creator>rescobar</dc:creator>
      <dc:date>2023-01-13T16:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I fix this runtime error from addAllValues()?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-fix-this-runtime-error-from-addallvalues/m-p/1249116#M66588</link>
      <description>&lt;P&gt;Add some print statements before the hab_lyr.symbology.addAllValues() so you know which layer is causing that error.&amp;nbsp; I tried it on a couple of my datasets and it didn't throw that error so you'll have to do some more debugging to narrow the issue down.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;print 'changing: {}'.format(hab_lyr.name)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 18 Jan 2023 16:34:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-fix-this-runtime-error-from-addallvalues/m-p/1249116#M66588</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-01-18T16:34:09Z</dc:date>
    </item>
  </channel>
</rss>

