<?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: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1157200#M64141</link>
    <description>&lt;P&gt;I contacted ESRI customer support for this issue and it resulted in them submitting a ticket for a bug. (&lt;SPAN&gt;#BUG-000129995&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;The Layer symbology fails to update in the Script tool if the layer is accessed through a Script tool parameter.) Still waiting on a software update to resolve the issue. In the mean time, they do have a work around posted under this bug - I have not tried it yet though as I just saw it under the bug posting.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If layer is accessed through:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;p = arcpy.mp.ArcGISProject("CURRENT")&lt;/P&gt;&lt;P&gt;m = p.listMaps('Map')[0]&lt;/P&gt;&lt;P&gt;layer = arcpy.GetParameter(0) # FeatureLayer Parameter&lt;/P&gt;&lt;P&gt;fld1 = arcpy.GetParameter(1) # String Parameter&amp;nbsp;&lt;/P&gt;&lt;P&gt;fld2 = arcpy.GetParameter(2) # String Parameter&lt;/P&gt;&lt;P&gt;sym = layer.symbology&lt;/P&gt;&lt;P&gt;layer = m.listLayers(layer.name)[0]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;There is no issue.&lt;/P&gt;&lt;P&gt;Use stand alone Python script using arcpy.mp.ArcGISProject.SaveACopy().&lt;/P&gt;</description>
    <pubDate>Thu, 24 Mar 2022 11:06:22 GMT</pubDate>
    <dc:creator>KristieReece</dc:creator>
    <dc:date>2022-03-24T11:06:22Z</dc:date>
    <item>
      <title>arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1137999#M63601</link>
      <description>&lt;P&gt;Attempting to use arcpy.management.ApplySymbologyFromLayer in a python script being run in a model.&lt;/P&gt;&lt;P&gt;Immediate Window:&lt;/P&gt;&lt;P&gt;aprxMap = aprx.listMaps("Layer1")[0]&lt;/P&gt;&lt;P&gt;lyr = aprxMap.listLayers("PointLayer")[0]&lt;/P&gt;&lt;P&gt;arcpy.management.ApplySymbologyFromLayer(lyr, "Q:\GIS_Data\Symbology_Layers\TypeSymbology.lyr")&lt;/P&gt;&lt;P&gt;After reviewing the following link, I attempted that formatting as well within the script, but still not seeing any updates to the symbology. The script runs through with no errors, but nothing changes. Works perfectly in the immediate window though.&lt;/P&gt;&lt;P&gt;Reference the following documentation for creating the script:&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/apply-symbology-from-layer.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/apply-symbology-from-layer.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 18:43:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1137999#M63601</guid>
      <dc:creator>KristieReece</dc:creator>
      <dc:date>2022-01-27T18:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1138161#M63606</link>
      <description>&lt;P&gt;In immediate mode, I assume you are using a python notebook or the python window inside Pro&lt;/P&gt;&lt;P&gt;Is the model being run from within a toolbox?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 22:22:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1138161#M63606</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-01-27T22:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1138184#M63609</link>
      <description>&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I am using the python window in ArcGIS Pro to test the code at which point it does everything as expected. The same code is then saved as a script in a toolbox. When run from the tool box the script runs with no errors, BUT the symbology is not changed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kristie&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 23:31:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1138184#M63609</guid>
      <dc:creator>KristieReece</dc:creator>
      <dc:date>2022-01-27T23:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1138213#M63610</link>
      <description>&lt;P&gt;I don't usually update symbology, but I do know that results from a tool should be added to a display, which makes me think that there is no "update" for existing layers.&lt;/P&gt;&lt;P&gt;On a lark, if you toggle off the layer, then toggle it back on, does it update?&lt;/P&gt;&lt;P&gt;If not, check&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1325"&gt;@curtvprice&lt;/a&gt;&amp;nbsp;'s comments in&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/geoprocessing-questions/question-on-apply-symbology-layer-for-modelbuilder/m-p/466839" target="_blank"&gt;Question on Apply symbology layer for modelbuilder... - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If he catches this he probably has some ideas&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 01:20:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1138213#M63610</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-01-28T01:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1138312#M63611</link>
      <description>&lt;P&gt;Unfortunately, toggling the layer did not cause it to update. I looked at the link you provided, and I am familiar with that method of applying symbology to the output of the tool; however, I do not believe that works in this situation as this portion of my model is actually a python script, so I do not believe I can utilize that feature here. The model runs all of the analysis tools and saves the outputs in a specified geodatabase. The python script then goes through and adds all of the output layers to their respective layouts and then is supposed to apply symbology prior to exporting all of the layouts to png.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 13:13:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1138312#M63611</guid>
      <dc:creator>KristieReece</dc:creator>
      <dc:date>2022-01-28T13:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1138355#M63612</link>
      <description>&lt;P&gt;off to Tech Support to see if it is a bug or working as expected would be my suggestion&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 14:51:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1138355#M63612</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-01-28T14:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1138484#M63613</link>
      <description>&lt;P&gt;After doing some testing I have been somewhat able to use the information in the link you provided to update symbology; however, have come across a new issue with inconsistency. To sum up the overall model, its starts with an overall data set and then makes multiple subsets of that data by the specified categories and the applies the same layer file for the symbology to each of them. When applying the symbology it only applies it correctly to maybe half of the subsets and is inconsistent in choosing which ones are properly loaded every time the tool runs. I am waiting for my administrator to allow my account access to chat with tech support.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for all of your help!&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 19:00:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1138484#M63613</guid>
      <dc:creator>KristieReece</dc:creator>
      <dc:date>2022-01-28T19:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1156936#M64133</link>
      <description>&lt;P&gt;Any updates on this? I am having similar issues and also get the same results when running from the python window in ArcGIS Pro. Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 18:55:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1156936#M64133</guid>
      <dc:creator>ErikGarcia1</dc:creator>
      <dc:date>2022-03-23T18:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1157200#M64141</link>
      <description>&lt;P&gt;I contacted ESRI customer support for this issue and it resulted in them submitting a ticket for a bug. (&lt;SPAN&gt;#BUG-000129995&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;The Layer symbology fails to update in the Script tool if the layer is accessed through a Script tool parameter.) Still waiting on a software update to resolve the issue. In the mean time, they do have a work around posted under this bug - I have not tried it yet though as I just saw it under the bug posting.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If layer is accessed through:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;p = arcpy.mp.ArcGISProject("CURRENT")&lt;/P&gt;&lt;P&gt;m = p.listMaps('Map')[0]&lt;/P&gt;&lt;P&gt;layer = arcpy.GetParameter(0) # FeatureLayer Parameter&lt;/P&gt;&lt;P&gt;fld1 = arcpy.GetParameter(1) # String Parameter&amp;nbsp;&lt;/P&gt;&lt;P&gt;fld2 = arcpy.GetParameter(2) # String Parameter&lt;/P&gt;&lt;P&gt;sym = layer.symbology&lt;/P&gt;&lt;P&gt;layer = m.listLayers(layer.name)[0]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;There is no issue.&lt;/P&gt;&lt;P&gt;Use stand alone Python script using arcpy.mp.ArcGISProject.SaveACopy().&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 11:06:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1157200#M64141</guid>
      <dc:creator>KristieReece</dc:creator>
      <dc:date>2022-03-24T11:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1157245#M64142</link>
      <description>&lt;P&gt;Thanks Kristie,&lt;/P&gt;&lt;P&gt;I got around it by automating my AGOL layer upload. I used the itemID of the layer I shared that had the symbology I wanted to apply. After that I automated my layer upload and used the same itemID and that updated the layer while keeping the same symbology.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your response!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 13:12:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1157245#M64142</guid>
      <dc:creator>ErikGarcia1</dc:creator>
      <dc:date>2022-03-24T13:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1236146#M66179</link>
      <description>&lt;P&gt;Hi Kristie,&lt;/P&gt;&lt;P&gt;I am having a similar problem (Pro 3.0.2) where the apply symbology works fine running it in a Notebook, but doesn't apply when running from a script tool. Did you ever get a resolution to this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Rosemary&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 20:40:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1236146#M66179</guid>
      <dc:creator>RosemaryHatch</dc:creator>
      <dc:date>2022-11-29T20:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1260904#M66922</link>
      <description>&lt;P&gt;Check and apply the right parameters to update the layer symbology&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AvinashPatel_0-1677164442946.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63514i6B1E6DC426D423A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AvinashPatel_0-1677164442946.png" alt="AvinashPatel_0-1677164442946.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;import sys&lt;BR /&gt;def ScriptTool(param0, param1):&lt;BR /&gt;# Script execution code goes here&lt;BR /&gt;return&lt;BR /&gt;# This is used to execute code if the file was run but not imported&lt;BR /&gt;if __name__ == '__main__':&lt;BR /&gt;# Tool parameter accessed with GetParameter or GetParameterAsText&lt;BR /&gt;param0 = arcpy.GetParameterAsText(0)&lt;BR /&gt;param1 = arcpy.GetParameterAsText(1)&lt;BR /&gt;&lt;BR /&gt;ScriptTool(param0, param1)&lt;BR /&gt;arcpy.management.ApplySymbologyFromLayer(param0, param1, None, "DEFAULT")&lt;BR /&gt;&lt;BR /&gt;# Update derived parameter values using arcpy.SetParameter() or arcpy.SetParameterAsText()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 15:02:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1260904#M66922</guid>
      <dc:creator>AvinashPatel</dc:creator>
      <dc:date>2023-02-23T15:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1316264#M68360</link>
      <description>&lt;P&gt;When run as a script,&amp;nbsp;&lt;SPAN&gt;arcpy.management.ApplySymbologyFromLayer returns a new layer but does not modify any of it's inputs. Something like this should do the job?&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Apply symbology changes to lyr, which will create a new finalLayer:
finalLayer = arcpy.management.ApplySymbologyFromLayer(lyr, "Q:\GIS_Data\Symbology_Layers\TypeSymbology.lyr")
# Remove the original lyr from aprxMap
aprxMap.removeLayer(lyr)
# Add the new layer that has the symbology applied
aprxMap.addLayer(finalLayer[0])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 04:49:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1316264#M68360</guid>
      <dc:creator>Ramitha</dc:creator>
      <dc:date>2023-08-08T04:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1513813#M71189</link>
      <description>&lt;P&gt;This worked for me. Thank you!! I wish it was part of the documentation.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 18:19:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1513813#M71189</guid>
      <dc:creator>MK13</dc:creator>
      <dc:date>2024-08-01T18:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management,ApplySymbologyFromLayer works from immediate window, but not when running saved script</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1559374#M73201</link>
      <description>&lt;P&gt;This worked for me as well!! Thank you!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;tempLayer&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;active_map&lt;/SPAN&gt;&lt;SPAN&gt;.addDataFromPath(&lt;/SPAN&gt;&lt;SPAN&gt;local_peaks&lt;/SPAN&gt;&lt;SPAN&gt;) &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;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outlayer&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.management.ApplySymbologyFromLayer(&lt;/SPAN&gt;&lt;SPAN&gt;tempLayer&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;layer_file_path&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;active_map&lt;/SPAN&gt;&lt;SPAN&gt;.removeLayer(&lt;/SPAN&gt;&lt;SPAN&gt;tempLayer&lt;/SPAN&gt;&lt;SPAN&gt;) &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;active_map&lt;/SPAN&gt;&lt;SPAN&gt;.addLayer(&lt;/SPAN&gt;&lt;SPAN&gt;outlayer&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:19:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-applysymbologyfromlayer-works/m-p/1559374#M73201</guid>
      <dc:creator>adunckel_nrcs</dc:creator>
      <dc:date>2024-11-15T21:19:01Z</dc:date>
    </item>
  </channel>
</rss>

