<?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: problem with ApplySymbologyFromLayer_management not applying symbology in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/problem-with-applysymbologyfromlayer-management/m-p/648863#M50497</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've done something very similar.&amp;nbsp; My code was for 10.0, but it still works in 10.1.&amp;nbsp; I'm not sure if there's a new, better way to do this, but here's the relevant section of my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
arcpy.MakeFeatureLayer_management("myFC", "My Layer Name")
addLayer = arcpy.mapping.Layer("My Layer Name")
arcpy.mapping.AddLayer(df,addLayer, "TOP")
sourceLayer = "C:\Data\MySymbology.lyr"
layerSymb = arcpy.mapping.Layer(sourceLayer)
updateLayer = arcpy.mapping.ListLayers(mxd, "My Layer Name", df)[0]
arcpy.mapping.UpdateLayer(df, updateLayer, layerSymb, "TRUE")
arcpy.RefreshTOC()
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Erik&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 03:30:20 GMT</pubDate>
    <dc:creator>ErikMartin</dc:creator>
    <dc:date>2021-12-12T03:30:20Z</dc:date>
    <item>
      <title>problem with ApplySymbologyFromLayer_management not applying symbology</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-applysymbologyfromlayer-management/m-p/648862#M50496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am running ArcGIS v10.1. Here is a snippet of my arcpy code.&amp;nbsp; I am trying to apply symbology to point features.&amp;nbsp; The layer to display and my symbology layer both have the attribute "DESCRIPT" to match to.&amp;nbsp; I can apply the symbology manually in ArcMap, but when I try this code, it does not do it, even with a screen refresh.&amp;nbsp; Any ideas as to the problem?&amp;nbsp; The screen capture shows the layer added to the top of the TOC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Karl&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_______________&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;layerName = "crime_95"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outFeature = "crimejoinKK.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;crimeLayer = "crimejoinLayer"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;symbologyLayer =&amp;nbsp; r"C:\temp\CrimeTypes.lyr"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;crimeType = "CrimeTypes"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Process: Copy layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Copy the crime layer to a new permanent feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CopyFeatures_management(layerName, outFeature)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# First, Add Field - need to add a field that will match the field in the symbology layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AddField_management(outFeature, "DESCRIPT", "TEXT") &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Then Calculate Field - calculate the field with the crime descriptions&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CalculateField_management(outFeature, "DESCRIPT", "[crime95d_9]", "VB", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Make a temporary layer to apply the symbology to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeFeatureLayer_management(outFeature, crimeLayer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#BELOW IS WHERE THE PROBLEM IS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#I am adding crimeLayer to the data frame, then applying symbology to it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#The point symbols show up, but not the symbology applied to them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;addCrimeLayer = arcpy.mapping.Layer(crimeLayer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df = arcpy.mapping.ListDataFrames(mxd, "New Data Frame")[0] &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.mapping.AddLayer(df, addCrimeLayer, "TOP")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.ApplySymbologyFromLayer_management(addCrimeLayer, symbologyLayer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.RefreshActiveView()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;----------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]22229[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2013 18:55:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-applysymbologyfromlayer-management/m-p/648862#M50496</guid>
      <dc:creator>karlkliparchuk1</dc:creator>
      <dc:date>2013-02-27T18:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ApplySymbologyFromLayer_management not applying symbology</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-applysymbologyfromlayer-management/m-p/648863#M50497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've done something very similar.&amp;nbsp; My code was for 10.0, but it still works in 10.1.&amp;nbsp; I'm not sure if there's a new, better way to do this, but here's the relevant section of my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
arcpy.MakeFeatureLayer_management("myFC", "My Layer Name")
addLayer = arcpy.mapping.Layer("My Layer Name")
arcpy.mapping.AddLayer(df,addLayer, "TOP")
sourceLayer = "C:\Data\MySymbology.lyr"
layerSymb = arcpy.mapping.Layer(sourceLayer)
updateLayer = arcpy.mapping.ListLayers(mxd, "My Layer Name", df)[0]
arcpy.mapping.UpdateLayer(df, updateLayer, layerSymb, "TRUE")
arcpy.RefreshTOC()
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Erik&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:30:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-applysymbologyfromlayer-management/m-p/648863#M50497</guid>
      <dc:creator>ErikMartin</dc:creator>
      <dc:date>2021-12-12T03:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ApplySymbologyFromLayer_management not applying symbology</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-applysymbologyfromlayer-management/m-p/648864#M50498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks! It works! I was having exactly the same problem I don't know why&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jan 2014 10:07:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-applysymbologyfromlayer-management/m-p/648864#M50498</guid>
      <dc:creator>MIGUELFERNANDEZ1</dc:creator>
      <dc:date>2014-01-20T10:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ApplySymbologyFromLayer_management not applying symbology</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-applysymbologyfromlayer-management/m-p/648865#M50499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had the same problem. I think it is because the "Value Field" is set to "Single symbol" by default.&amp;nbsp; The code below worked for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lyr = "&lt;EM&gt;path to your layer&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;in_symbol_layer = "&lt;EM&gt;path to your symbology layer&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;addLayer = arcpy.mappling.Layer(lyr)&lt;/P&gt;&lt;P&gt;addLayer.valueField = "&lt;EM&gt;the value field you want to use for the symbol&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;arcpy.ApplySymbologyFromLayer_management(lyr, in_symbol_layer)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 18:48:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-applysymbologyfromlayer-management/m-p/648865#M50499</guid>
      <dc:creator>MakikoShukunobe</dc:creator>
      <dc:date>2014-12-17T18:48:19Z</dc:date>
    </item>
  </channel>
</rss>

