<?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: Python UpdateLayer works in V10 but not in 10.1 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679481#M52652</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry I missed one thing in my code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Error is caused by list as argument, simple correction should help. Script will work, as long as layer names in data frame will be unique.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Try this one:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;1&amp;gt;&amp;gt;&amp;gt; SubjectLyr = arcpy.mapping.Layer("Y:\\Notification Radius Pkgs\\Dave3\\Shapefiles\\Dave3Subject.shp") # use either \\ or / in paths 2&amp;gt;&amp;gt;&amp;gt; mxd = arcpy.mapping.MapDocument("CURRENT") 3&amp;gt;&amp;gt;&amp;gt; df = arcpy.mapping.ListDataFrames(mxd, "Radius Map")[0]&amp;nbsp; 4&amp;gt;&amp;gt;&amp;gt; wPath = "Y:\\Notification Radius Pkgs\\" # same as in line 1 5&amp;gt;&amp;gt;&amp;gt; arcpy.mapping.AddLayer(df, SubjectLyr,"AUTO_ARRANGE")&amp;nbsp; 6&amp;gt;&amp;gt;&amp;gt; SubjectLyr = arcpy.mapping.ListLayers(mxd, SubjectLyr.name, df)[0] # change reference to layer in mxd 7&amp;gt;&amp;gt;&amp;gt; sourceLayer = arcpy.mapping.Layer(wPath+"Setup10\\LayerFiles\\Subject.lyr") # same as in line 1 8&amp;gt;&amp;gt;&amp;gt; arcpy.mapping.UpdateLayer(df, SubjectLyr, sourceLayer, True)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Oct 2012 13:19:27 GMT</pubDate>
    <dc:creator>ArkadiuszMatoszka</dc:creator>
    <dc:date>2012-10-18T13:19:27Z</dc:date>
    <item>
      <title>Python UpdateLayer works in V10 but not in 10.1</title>
      <link>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679478#M52649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a script written in v10 that compiles a series of maps and mailing labels based on a buffered distance around a parcel.&amp;nbsp; The script runs fine in V10.&amp;nbsp; In V10.1 it runs without error but does not symbolize correctly based on a layer files, specifically using UpdateLayer.&amp;nbsp; After UpdateLayer is processed, the screen refreshes but the symbols set in the layer file do not get processed.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What has changed in 10.1 that would cause this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone else come across this issue?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is an example that I copied from the python window in trying to emulate the script.&amp;nbsp; It does not apply the symbology either:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; SubjectLyr = arcpy.mapping.Layer("Y:\Notification Radius Pkgs\Dave3\Shapefiles\Dave3Subject.shp")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; mxd = arcpy.mapping.MapDocument("Current")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; df = arcpy.mapping.ListDataFrames(mxd, "Radius Map")[0] &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; wPath = "Y:\Notification Radius Pkgs\\"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.mapping.AddLayer(df, SubjectLyr,"AUTO_ARRANGE") &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; sourceLayer = arcpy.mapping.Layer(wPath+"Setup10\LayerFiles\Subject.lyr")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.mapping.UpdateLayer(df, SubjectLyr, sourceLayer, True)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2012 17:48:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679478#M52649</guid>
      <dc:creator>DaveJordan1</dc:creator>
      <dc:date>2012-10-17T17:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Python UpdateLayer works in V10 but not in 10.1</title>
      <link>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679479#M52650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Firstly use \\ or / to separate path. Also after adding layer to map document you have to change reference to this layer (layer on disk and in map document is not the same layer!)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Below your code with some changes that make it work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
1&amp;gt;&amp;gt;&amp;gt; SubjectLyr = arcpy.mapping.Layer("Y:\\Notification Radius Pkgs\\Dave3\\Shapefiles\\Dave3Subject.shp") # use either \\ or / in paths
2&amp;gt;&amp;gt;&amp;gt; mxd = arcpy.mapping.MapDocument("CURRENT")
3&amp;gt;&amp;gt;&amp;gt; df = arcpy.mapping.ListDataFrames(mxd, "Radius Map")[0] 
4&amp;gt;&amp;gt;&amp;gt; wPath = "Y:\\Notification Radius Pkgs\\" # same as in line 1
5&amp;gt;&amp;gt;&amp;gt; arcpy.mapping.AddLayer(df, SubjectLyr,"AUTO_ARRANGE") 
6&amp;gt;&amp;gt;&amp;gt; &lt;STRONG&gt;SubjectLyr = arcpy.mapping.ListLayers(mxd, SubjectLyr.name, df) # change reference to layer in mxd&lt;/STRONG&gt;
7&amp;gt;&amp;gt;&amp;gt; sourceLayer = arcpy.mapping.Layer(wPath+"Setup10\\LayerFiles\\Subject.lyr")[0] # same as in line 1
8&amp;gt;&amp;gt;&amp;gt; arcpy.mapping.UpdateLayer(df, SubjectLyr, sourceLayer, True)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Arek&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:37:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679479#M52650</guid>
      <dc:creator>ArkadiuszMatoszka</dc:creator>
      <dc:date>2021-12-12T04:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Python UpdateLayer works in V10 but not in 10.1</title>
      <link>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679480#M52651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Arek, Thank you for taking the time to reply.&amp;nbsp; nfortuneatley, I was not successfull in getting yuor sample to work.&amp;nbsp; I believe it is because ListLayer returns a list of layers rather than a layer. here is what I am getting:&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; SubjectLyr = arcpy.mapping.Layer("Y:\\Notification Radius Pkgs\\Dave3\\Shapefiles\\Dave3Subject.shp")
&amp;gt;&amp;gt;&amp;gt; mxd = arcpy.mapping.MapDocument("CURRENT")
&amp;gt;&amp;gt;&amp;gt; df = arcpy.mapping.ListDataFrames(mxd, "Radius Map")[0]
&amp;gt;&amp;gt;&amp;gt; wPath = "Y:\\Notification Radius Pkgs\\"
&amp;gt;&amp;gt;&amp;gt; arcpy.mapping.AddLayer(df, SubjectLyr,"AUTO_ARRANGE") 
&amp;gt;&amp;gt;&amp;gt; SubjectLyr = arcpy.mapping.ListLayers(mxd, SubjectLyr.name, df)
&amp;gt;&amp;gt;&amp;gt; sourceLayer = arcpy.mapping.Layer(wPath+"Setup10\\LayerFiles\\Subject.lyr")[0]
Runtime error 
Traceback (most recent call last):
&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;
TypeError: 'Layer' object does not support indexing
&lt;STRONG&gt;#####Okay - get rid of the index&lt;/STRONG&gt;
&amp;gt;&amp;gt;&amp;gt; sourceLayer = arcpy.mapping.Layer(wPath+"Setup10\\LayerFiles\\Subject.lyr")
&amp;gt;&amp;gt;&amp;gt; arcpy.mapping.UpdateLayer(df, SubjectLyr, sourceLayer, True)
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 (x86)\arcgis\desktop10.1\arcpy\arcpy\utils.py", line 181, in fn_
&amp;nbsp;&amp;nbsp;&amp;nbsp; return fn(*args, **kw)
&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\mapping.py", line 1868, in UpdateLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; assert isinstance(update_layer, Layer)
AssertionError
&amp;gt;&amp;gt;&amp;gt; arcpy.mapping.Layer(wPath+"Setup10\LayerFiles\Subject.lyr")
&amp;lt;map layer u'Dave502Subject'&amp;gt;
&amp;gt;&amp;gt;&amp;gt; arcpy.mapping.UpdateLayer(df, SubjectLyr, sourceLayer, True)
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 (x86)\arcgis\desktop10.1\arcpy\arcpy\utils.py", line 181, in fn_
&amp;nbsp;&amp;nbsp;&amp;nbsp; return fn(*args, **kw)
&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\mapping.py", line 1868, in UpdateLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; assert isinstance(update_layer, Layer)
AssertionError
&lt;STRONG&gt;####What are the values of the variables?&lt;/STRONG&gt;
&amp;gt;&amp;gt;&amp;gt; print SubjectLyr
[&amp;lt;map layer u'Dave3Subject'&amp;gt;]
&amp;gt;&amp;gt;&amp;gt; print sourceLayer
Dave502Subject&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ESRI support is telling me that this issue may be a bug in v10.1&amp;nbsp; They gave me a work-around, but I haven't tested it yet.&amp;nbsp; I will test it and report the results here.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:37:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679480#M52651</guid>
      <dc:creator>DaveJordan1</dc:creator>
      <dc:date>2021-12-12T04:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Python UpdateLayer works in V10 but not in 10.1</title>
      <link>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679481#M52652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry I missed one thing in my code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Error is caused by list as argument, simple correction should help. Script will work, as long as layer names in data frame will be unique.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Try this one:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;1&amp;gt;&amp;gt;&amp;gt; SubjectLyr = arcpy.mapping.Layer("Y:\\Notification Radius Pkgs\\Dave3\\Shapefiles\\Dave3Subject.shp") # use either \\ or / in paths 2&amp;gt;&amp;gt;&amp;gt; mxd = arcpy.mapping.MapDocument("CURRENT") 3&amp;gt;&amp;gt;&amp;gt; df = arcpy.mapping.ListDataFrames(mxd, "Radius Map")[0]&amp;nbsp; 4&amp;gt;&amp;gt;&amp;gt; wPath = "Y:\\Notification Radius Pkgs\\" # same as in line 1 5&amp;gt;&amp;gt;&amp;gt; arcpy.mapping.AddLayer(df, SubjectLyr,"AUTO_ARRANGE")&amp;nbsp; 6&amp;gt;&amp;gt;&amp;gt; SubjectLyr = arcpy.mapping.ListLayers(mxd, SubjectLyr.name, df)[0] # change reference to layer in mxd 7&amp;gt;&amp;gt;&amp;gt; sourceLayer = arcpy.mapping.Layer(wPath+"Setup10\\LayerFiles\\Subject.lyr") # same as in line 1 8&amp;gt;&amp;gt;&amp;gt; arcpy.mapping.UpdateLayer(df, SubjectLyr, sourceLayer, True)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 13:19:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679481#M52652</guid>
      <dc:creator>ArkadiuszMatoszka</dc:creator>
      <dc:date>2012-10-18T13:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Python UpdateLayer works in V10 but not in 10.1</title>
      <link>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679482#M52653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is a known issue:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NIM085743 - UpdateLayer will not update symbology if the source layer object is not in the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We will address it in a future service pack.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 16:01:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679482#M52653</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2012-10-18T16:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Python UpdateLayer works in V10 but not in 10.1</title>
      <link>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679483#M52654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes it is known issue, However, Arek's reply above works for those that can not wait for the the next service pack or are looking for an alternative.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Arek - you just made my day!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the response that I received from ESRI support which conincides with Areks solution exactly:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Hi Dave,&lt;BR /&gt;&lt;BR /&gt;I have verified this and logged it as an equivalency bug: [#NIM085743&amp;nbsp; UpdateLayer will not update symbology if the source layer object is not in the map]. What I found is that if you add the layers to the map, then grab the layer object and set that equal to your subject and source variables, then this seems to work. The issue appears to be with pointing to an external layer/shp file. I will test this a bit, but you may need to set your variable equal to arcpy.mapping.ListLayers and use a wildcard to get the layer you add to the map. You can then use that variable in the UpdateLayer tool. I'll test this some more and let you know exactly what I can find. Thanks for your patience with this Dave.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 16:27:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679483#M52654</guid>
      <dc:creator>DaveJordan1</dc:creator>
      <dc:date>2012-10-18T16:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Python UpdateLayer works in V10 but not in 10.1</title>
      <link>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679484#M52655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Another solution reccomended by support is to use &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;arcpy.ApplySymbologyFromLayer_management("Subject", "Source")&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;I haven't tried it myself as Arek's solution is working...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 16:36:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679484#M52655</guid>
      <dc:creator>DaveJordan1</dc:creator>
      <dc:date>2012-10-18T16:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Python UpdateLayer works in V10 but not in 10.1</title>
      <link>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679485#M52656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After further evaluation, there is an error in the original code - it is easy to miss. The Layer function is being used to reference a feature class on disk, not a layer file. It is documented that the Layer function is for referencing layer files. The bug is that an error should have been thrown. It should not have worked in 10.0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Original code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
SubjectLyr = arcpy.mapping.Layer("Y:\Notification Radius Pkgs\Dave3\Shapefiles\Dave3Subject.shp")
mxd = arcpy.mapping.MapDocument("Current")
df = arcpy.mapping.ListDataFrames(mxd, "Radius Map")[0] 
wPath = "Y:\Notification Radius Pkgs\\"
arcpy.mapping.AddLayer(df, SubjectLyr,"AUTO_ARRANGE") 
sourceLayer = arcpy.mapping.Layer(wPath+"Setup10\LayerFiles\Subject.lyr")
arcpy.mapping.UpdateLayer(df, SubjectLyr, sourceLayer, True)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:46:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679485#M52656</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-12-12T16:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Python UpdateLayer works in V10 but not in 10.1</title>
      <link>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679486#M52657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you provide me a sample of how I should have approached this? This was one of the first things i tried sorting out when I first started in Python. Somewhere after this interesting post &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/44502-Managing-Symbology-using-Python?p=207177#post207177" rel="nofollow noopener noreferrer" target="_blank"&gt;Managing-Symbology-using-Python&lt;/A&gt;&lt;SPAN&gt; I guess I bastardized it and made it work... I guess I assumed that the AddLayer call changed the reference to a layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SubjectLyr = arcpy.mapping.Layer("Y:\Notification Radius Pkgs\Dave3\Shapefiles\Dave3Subject.shp")
mxd = arcpy.mapping.MapDocument("Current")
df = arcpy.mapping.ListDataFrames(mxd, "Radius Map")[0] 
wPath = "Y:\Notification Radius Pkgs\\"
arcpy.mapping.&lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;AddLayer&lt;/SPAN&gt;(df, SubjectLyr,"AUTO_ARRANGE") 
sourceLayer = arcpy.mapping.Layer(wPath+"Setup10\LayerFiles\Subject.lyr")
arcpy.mapping.UpdateLayer(df, SubjectLyr, sourceLayer, True)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:37:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679486#M52657</guid>
      <dc:creator>DaveJordan1</dc:creator>
      <dc:date>2021-12-12T04:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Python UpdateLayer works in V10 but not in 10.1</title>
      <link>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679487#M52658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dave,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Again in your most recent post, you are referencing a shapefile via the Layer function.&amp;nbsp; You must reference a layer file.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To fix this, add your shapefile into ArcMap, symboloize it however and then save out to a layer file (*.lyr).&amp;nbsp; Then replace the path to the shapefile with the path to the lyr file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;UpdateLayer will update all layer properties, including dataSource, if your set symbology_only=False.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 15:07:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679487#M52658</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2012-10-22T15:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Python UpdateLayer works in V10 but not in 10.1</title>
      <link>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679488#M52659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I understand that I was referencing a shapefile via the layer function.&amp;nbsp; The logic that I am trying to build is to use layer files to drive the symbology for multiple mxds and shapefiles.&amp;nbsp; My script generates shapefiles based on user input, and then provides a standardized map series with consistant symbolization based on layer files.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, following your logic, "To fix this, add your shapefile into ArcMap, symboloize it however and then save out to a layer file (*.lyr). Then &lt;/SPAN&gt;&lt;STRONG&gt;replace the path to the shapefile with the path to the lyr file&lt;/STRONG&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know how to do this manually, how would you scrpt it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 19:41:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679488#M52659</guid>
      <dc:creator>DaveJordan1</dc:creator>
      <dc:date>2012-10-22T19:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Python UpdateLayer works in V10 but not in 10.1</title>
      <link>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679489#M52660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The code you had is was almost exactly what you needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
mxd = arcpy.mapping.MapDocument( path to mxd )
df = arcpy.mapping.ListDataFrames(mxd)[0]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ###UpdateLayer requires a data frame reference (returns 1st df)
lyrFile = arcpy.mapping.Layer( path to lyr file )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ###This is a lyr file with pre-authored symbology you will apply to layer
lyr = arcpy.mapping.ListLayers(mxd, "layer name", df)[0]&amp;nbsp;&amp;nbsp; ###A reference to the shapefile layer in MXD you want to update.
arcpy.mapping.UpdateLayer(df, lyr, lyrFile, True)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ###This will update ONLY the symbology
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For more help on UpdateLayer, please refer to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/#/UpdateLayer/00s30000003p000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/#/UpdateLayer/00s30000003p000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:37:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679489#M52660</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-12-12T04:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Python UpdateLayer works in V10 but not in 10.1</title>
      <link>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679490#M52661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello. I am having a similar issue with UpdateLayer in arcpy; however, the fix posted in this thread still isn't working for me 100% of the time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a script that calculates kernel density for several sets of points, adds the output to a base map, updates the added layer to use the same color scheme and resampling function of a template layer, then zooms to the extent of the new layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This works fine for some of the resulting maps; the density output shows on the map, the color is as it should be, and it is sampled using bilinear interpolation as I wanted. The problem is that most of the resulting maps do not show the kernel output at all; only the basemap is visible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have isolated the code I am using and have altered it to compute one simple test case. Here is what I have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SubjectLyr = arcpy.mapping.Layer(r"F:\\testFiles\\output\\Population23_KDens.lyr")
mxd = arcpy.mapping.MapDocument("F:\\testFiles\\testMap.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0] 
wPath = "F:\\testFiles\\output\\" # same as in line 1

#Add the layer to basemap
arcpy.mapping.AddLayer(df, SubjectLyr,"AUTO_ARRANGE") 

#Update the layer
SubjectLyr = arcpy.mapping.ListLayers(mxd, SubjectLyr.name, df)[0] # change reference to layer in mxd
sourceLayer = arcpy.mapping.Layer(wPath+"templates\\template.lyr") # get template layer
arcpy.mapping.UpdateLayer(df, SubjectLyr, sourceLayer, True)

###Zoom to selection
df.zoomToSelectedFeatures()
lyrExtent = SubjectLyr.getSelectedExtent()
df.extent = lyrExtent
arcpy.mapping.ExportToPDF(mxd, r"F:\\testFiles\\output\\Population23_KDens_Map.pdf")
print('DONE!')&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As shown, my code is practically identical to the code that is a "workaround" to this problem described in the above posts, so I am not quite sure what is going wrong! This code works for some, but not all of my datasets.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have also tried using the ApplySymbologyFromLayer_management() function instead of UpdateLayer, which does make all the kdens output layers apper; however, this does not change the resampling function used when drawing the output, and I need to to use bilinear interpolation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know what could be going on? Are there any other functions I could use? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:37:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-updatelayer-works-in-v10-but-not-in-10-1/m-p/679490#M52661</guid>
      <dc:creator>HannahP</dc:creator>
      <dc:date>2021-12-12T04:37:34Z</dc:date>
    </item>
  </channel>
</rss>

