<?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: Change symbology of a shapefile or layer using Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/change-symbology-of-a-shapefile-or-layer-using/m-p/58611#M4613</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The symbology is carrying over when I convert from layer to kml. However, the layer is created in the script using the make feature layer function, so I never get a chance to change the symbology in ArcMap. It appears that when the layer is created, it is just assigned a random color and that is what is shown in the kml. I'm curious if there is a script that will allow me to change the color.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the suggestion of using the apply symbology from layer. I did create a layer file with the red color symbology and it worked. The problem with this is that the user would always have to have that one layer file for it to work, so if there is a way to get it directly in the script it would be much better.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Mar 2014 16:59:03 GMT</pubDate>
    <dc:creator>JudyC</dc:creator>
    <dc:date>2014-03-19T16:59:03Z</dc:date>
    <item>
      <title>Change symbology of a shapefile or layer using Python</title>
      <link>https://community.esri.com/t5/python-questions/change-symbology-of-a-shapefile-or-layer-using/m-p/58609#M4611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a script that creates a layer and then converts it to a kmz. Is there a way to set the symbology of the layer file using Python in my script so that it shows up in the kml as the color I want?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, I have a layer file that displays building footprints and every time I use the layer to kml function it displays in Google Earth as a different color. I want it to display as red all the time. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using ArcMap 10.2 and Python 2.7.3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 19:07:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-symbology-of-a-shapefile-or-layer-using/m-p/58609#M4611</guid>
      <dc:creator>JudyC</dc:creator>
      <dc:date>2014-03-18T19:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Change symbology of a shapefile or layer using Python</title>
      <link>https://community.esri.com/t5/python-questions/change-symbology-of-a-shapefile-or-layer-using/m-p/58610#M4612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's odd that your symbology isn't carrying over.&amp;nbsp; I have a script that converts a series of layers (polygons, polylines, and points) to KMZ and seems to keep it's symbology fine. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One thins you could try is saving a copy or your preferred symbology somewhere on your system as a .lyr file and refer to that in your script to set symbology everytime the script runs.&amp;nbsp; Maybe something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.ApplySymbologyFromLayer_management(your_layer, symbology_layer)

arcpy.SaveToLayerFile_management(your_layer, layer_to_be_coverted_to_kmz)

arcpy.LayerToKML_conversion(layer_to_be_coverted_to_kmz, output_kmz,1,"NO_COMPOSITE","",1024,96,"CLAMPED_TO_GROUND")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:13:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-symbology-of-a-shapefile-or-layer-using/m-p/58610#M4612</guid>
      <dc:creator>MattEiben</dc:creator>
      <dc:date>2021-12-10T22:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Change symbology of a shapefile or layer using Python</title>
      <link>https://community.esri.com/t5/python-questions/change-symbology-of-a-shapefile-or-layer-using/m-p/58611#M4613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The symbology is carrying over when I convert from layer to kml. However, the layer is created in the script using the make feature layer function, so I never get a chance to change the symbology in ArcMap. It appears that when the layer is created, it is just assigned a random color and that is what is shown in the kml. I'm curious if there is a script that will allow me to change the color.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the suggestion of using the apply symbology from layer. I did create a layer file with the red color symbology and it worked. The problem with this is that the user would always have to have that one layer file for it to work, so if there is a way to get it directly in the script it would be much better.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2014 16:59:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-symbology-of-a-shapefile-or-layer-using/m-p/58611#M4613</guid>
      <dc:creator>JudyC</dc:creator>
      <dc:date>2014-03-19T16:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Change symbology of a shapefile or layer using Python</title>
      <link>https://community.esri.com/t5/python-questions/change-symbology-of-a-shapefile-or-layer-using/m-p/58612#M4614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've had this exact problem before.&amp;nbsp; Unfortunately, through the arcpy.mapping module, there's currently no support for Python having access to the actual color properties for your symbology.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This has certainly limited me on several scripts as well.&amp;nbsp; To my knowledge, currently the best way is to have a .lyr file repository or bundle it with the script and use the Apply Symbology tool or the Update Layer tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Read here for the currently available symbology options:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/UniqueValuesSymbology/00s30000005s000000/"&gt;arcpy mapping symbology options&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, check out this forum post with a very similar issue&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/90831-Programmatically-Set-Colors-for-Unique-Values-Symbology"&gt;http://forums.arcgis.com/threads/90831-Programmatically-Set-Colors-for-Unique-Values-Symbology&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2014 19:24:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-symbology-of-a-shapefile-or-layer-using/m-p/58612#M4614</guid>
      <dc:creator>MattEiben</dc:creator>
      <dc:date>2014-03-19T19:24:02Z</dc:date>
    </item>
  </channel>
</rss>

