<?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 to set the symbology categories using arcpy in Python Snippets Questions</title>
    <link>https://community.esri.com/t5/python-snippets-questions/how-to-set-the-symbology-categories-using-arcpy/m-p/757280#M58</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan&lt;/P&gt;&lt;P&gt;Seems that I can't get the links to work but you've given me the functions I need to use so that's the important point&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/201204_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 May 2016 23:09:10 GMT</pubDate>
    <dc:creator>PeterBirksmith</dc:creator>
    <dc:date>2016-05-17T23:09:10Z</dc:date>
    <item>
      <title>How to set the symbology categories using arcpy</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-to-set-the-symbology-categories-using-arcpy/m-p/757278#M56</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to learn how to modify/add categories within Symbology programmatically in arcpy.&lt;/P&gt;&lt;P&gt;I have created a Featurelayer from a shapefile.&amp;nbsp; Now I want to set the available categories&lt;/P&gt;&lt;P&gt;Is this possible and if so what is the code necessary to perform this function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 03:26:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-to-set-the-symbology-categories-using-arcpy/m-p/757278#M56</guid>
      <dc:creator>PeterBirksmith</dc:creator>
      <dc:date>2016-05-17T03:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the symbology categories using arcpy</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-to-set-the-symbology-categories-using-arcpy/m-p/757279#M57</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see arcpy.mapping ... for example&lt;/P&gt;&lt;P&gt;EDIT&amp;nbsp; the direct links didn't work so I will give references to the actual classes&lt;/P&gt;&lt;P&gt;in the arcpy mapping classes section &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/introduction-to-arcpy-mapping.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/introduction-to-arcpy-mapping.htm"&gt;Introduction to arcpy.mapping—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;UniqueValuesSymbology&lt;/P&gt;&lt;P&gt;GraduatedColorsSymbology&lt;/P&gt;&lt;P&gt;GraduatedSymbolsSymbology&lt;/P&gt;&lt;P&gt;The code samples will get you started&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 05:12:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-to-set-the-symbology-categories-using-arcpy/m-p/757279#M57</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-17T05:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the symbology categories using arcpy</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-to-set-the-symbology-categories-using-arcpy/m-p/757280#M58</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan&lt;/P&gt;&lt;P&gt;Seems that I can't get the links to work but you've given me the functions I need to use so that's the important point&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/201204_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 23:09:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-to-set-the-symbology-categories-using-arcpy/m-p/757280#M58</guid>
      <dc:creator>PeterBirksmith</dc:creator>
      <dc:date>2016-05-17T23:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the symbology categories using arcpy</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-to-set-the-symbology-categories-using-arcpy/m-p/757281#M59</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Peter, sometimes this happens and I still can't get them to work, but they are in the arcpy.mapping section under Classes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 23:33:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-to-set-the-symbology-categories-using-arcpy/m-p/757281#M59</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-17T23:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the symbology categories using arcpy</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-to-set-the-symbology-categories-using-arcpy/m-p/757282#M60</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/uniquevaluessymbology-class.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/uniquevaluessymbology-class.htm"&gt;Hi Dan&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;I've tried the snippet of code however, I think I need to understand a bit more about symbologyType and where it captures this attribute from within an mxd.&lt;/P&gt;&lt;P&gt;would you mind if I provided you the mxd as it's created from BOM shapefiles which produces the layers.&lt;/P&gt;&lt;P&gt;When I run the code SymbologyType comes back as 'OTHER'&lt;/P&gt;&lt;P&gt;I'm obviously missing something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print &lt;CODE&gt;&lt;SPAN class="n"&gt;lyr&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;symbologyType &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="n"&gt;Returns 'OTHER'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="k"&gt;if&lt;/SPAN&gt; &lt;SPAN class="n"&gt;lyr&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;symbologyType&lt;/SPAN&gt; &lt;SPAN class="o"&gt;==&lt;/SPAN&gt; &lt;SPAN class="s"&gt;"UNIQUE_VALUES"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="n"&gt;lyr&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;symbology&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;valueField&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="s"&gt;"SUB_REGION"&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="n"&gt;lyr&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;symbology&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;addAllValues&lt;/SPAN&gt;&lt;SPAN class="p"&gt;()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="n"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;RefreshActiveView&lt;/SPAN&gt;&lt;SPAN class="p"&gt;()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="n"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;RefreshTOC&lt;/SPAN&gt;&lt;SPAN class="p"&gt;()&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="p"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="p"&gt;Cheers&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="p"&gt;Peter&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 01:00:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-to-set-the-symbology-categories-using-arcpy/m-p/757282#M60</guid>
      <dc:creator>PeterBirksmith</dc:creator>
      <dc:date>2016-05-18T01:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the symbology categories using arcpy</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-to-set-the-symbology-categories-using-arcpy/m-p/757283#M61</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well OTHER means .... &lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 14px;"&gt;A string that represents an unsupported layer symbology class.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 14px;"&gt;So what is your symbology class, there is only the list in the layer class&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 14px;"&gt;What is the layer? a featureclass? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 14px;"&gt;You are running it from the current project as follows&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;mxd = arcpy.mapping.MapDocument("current")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # run from within a currently open project &lt;/P&gt;&lt;P&gt;lyr = arcpy.mapping.ListLayers(mxd, "Population")[0]&amp;nbsp;&amp;nbsp;&amp;nbsp; # this is a layer(s) called Population within the project [0] means get the 1st &lt;/P&gt;&lt;P&gt;if lyr.symbologyType == "UNIQUE_VALUES":&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # it then checks to see if this is the symbology type&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.symbology.valueField = "SUB_REGION"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # if it is, use a specific field in the layer's table&lt;/P&gt;&lt;P&gt;etc etc etc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 01:40:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-to-set-the-symbology-categories-using-arcpy/m-p/757283#M61</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-18T01:40:01Z</dc:date>
    </item>
  </channel>
</rss>

