<?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 use ApplySymbologyFromLayer in Python-script? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641348#M49973</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not used to seeing script tool without a dialog that allows you to select layers etc&amp;nbsp;&lt;A href="http://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/basics/create-a-python-script-tool.htm"&gt;http://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/basics/create-a-python-script-tool.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The need to refresh the map doesn't exist as an option as it did with ArcMap, so that can't be an issue.&amp;nbsp; That leaves something in the toolbox environment.&amp;nbsp; Try converting your hardcoded parameters into variables for selection&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Oct 2017 09:29:24 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2017-10-26T09:29:24Z</dc:date>
    <item>
      <title>How to use ApplySymbologyFromLayer in Python-script?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641345#M49970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ArcGIS Pro 1.4, 2D-Map&lt;/P&gt;&lt;P&gt;I'm trying to&amp;nbsp;change the symbology of a featureclass &amp;nbsp;through a layerfile (.lyrx):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;arcpy.MakeFeatureLayer_management("myFc", "myFc_lyr")&lt;/P&gt;&lt;P&gt;inputLayer = "myFc"&lt;BR /&gt;symbologyLayer = "myFc.lyrx"&lt;BR /&gt;symbologyFields = [["VALUE_FIELD", "StrKlasse", "StrKlasse"],["VALUE_FIELD", "Abschnitt_Ast", "Abschnitt_Ast"]]&lt;/P&gt;&lt;P&gt;arcpy.ApplySymbologyFromLayer_management (inputLayer, symbologyLayer, symbologyFields)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Running the commnds in the python-window, the symbology&amp;nbsp;will be&amp;nbsp;changed as expected, but in a python script from a toolbox nothing happens. The attributes in lyrx-file and the fc/layer match correctly.&lt;/P&gt;&lt;P&gt;Thanks for any solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 07:40:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641345#M49970</guid>
      <dc:creator>ThomasKölbel</dc:creator>
      <dc:date>2017-10-26T07:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ApplySymbologyFromLayer in Python-script?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641346#M49971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/apply-symbology-from-layer.htm"&gt;http://pro.arcgis.com/en/pro-app/tool-reference/data-management/apply-symbology-from-layer.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In both examples, not in immediate mode, the scripts set the arcpy.env variable (see examples 2 and 3)&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try adding that information since it is lacking your script&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 08:48:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641346#M49971</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-10-26T08:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ApplySymbologyFromLayer in Python-script?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641347#M49972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank's for your answer. I've tried:&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;from arcpy import env&lt;/P&gt;&lt;P&gt;env.workspace = r"C:\ArcGIS\Projects\MyProject6"&lt;/P&gt;&lt;P&gt;arcpy.MakeFeatureLayer_management("myFc", "myFc_lyr")&lt;/P&gt;&lt;P&gt;inputLayer = "myFc"&lt;BR /&gt;symbologyLayer = "myFc.lyrx"&lt;BR /&gt;symbologyFields = [["VALUE_FIELD", "StrKlasse", "StrKlasse"],["VALUE_FIELD", "Abschnitt_Ast", "Abschnitt_Ast"]]&lt;/P&gt;&lt;P&gt;arcpy.ApplySymbologyFromLayer_management (inputLayer, symbologyLayer, symbologyFields)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All sources are in the same Project folder.&amp;nbsp; The script runs and completes with no error, but nothing is changed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 09:03:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641347#M49972</guid>
      <dc:creator>ThomasKölbel</dc:creator>
      <dc:date>2017-10-26T09:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ApplySymbologyFromLayer in Python-script?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641348#M49973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not used to seeing script tool without a dialog that allows you to select layers etc&amp;nbsp;&lt;A href="http://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/basics/create-a-python-script-tool.htm"&gt;http://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/basics/create-a-python-script-tool.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The need to refresh the map doesn't exist as an option as it did with ArcMap, so that can't be an issue.&amp;nbsp; That leaves something in the toolbox environment.&amp;nbsp; Try converting your hardcoded parameters into variables for selection&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 09:29:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641348#M49973</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-10-26T09:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ApplySymbologyFromLayer in Python-script?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641349#M49974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the script runs as a standalone script, the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;arcpy.ApplySymbologyFromLayer_management&lt;SPAN&gt;&amp;nbsp; will probably have little effect if you don't:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;apply it to a layer in a MXD, refresh the map and store the MXD&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;or save the layer as a layerfile with the applied symbology&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 12:46:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641349#M49974</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2017-10-26T12:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ApplySymbologyFromLayer in Python-script?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641350#M49975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Converted the four Parameters inputLayer, symbologyLayer and ValueField1 and ValueField2 to selectable params in my script. No changes like before.&lt;/P&gt;&lt;P&gt;I've written some scripts before without dialogs - just running commands. They all worked well. So hardcoded params can be used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 13:29:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641350#M49975</guid>
      <dc:creator>ThomasKölbel</dc:creator>
      <dc:date>2017-10-26T13:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ApplySymbologyFromLayer in Python-script?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641351#M49976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no mxd in Pro. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 13:30:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641351#M49976</guid>
      <dc:creator>ThomasKölbel</dc:creator>
      <dc:date>2017-10-26T13:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ApplySymbologyFromLayer in Python-script?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641352#M49977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;same message as Xander... just called an *aprx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 13:34:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641352#M49977</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-10-26T13:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ApplySymbologyFromLayer in Python-script?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641353#M49978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having the same issue as the original poster but I am running ArcPro 2.6, python 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code to add symbology from a layer works great if I run it in a Notebook, but does not work when used in a script tool. When run in the script tool no errors are thrown, and a little lock icon shows up next to the input layer in the Contents window, so it looks like it is working, but the symbology is unchanged.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the geoprocessing tool and run AddSymbologyFromLayer, it works perfectly so I know it isn't a bad .lyrx or other file issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2020 01:22:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/641353#M49978</guid>
      <dc:creator>WillArellano</dc:creator>
      <dc:date>2020-09-29T01:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ApplySymbologyFromLayer in Python-script?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/1185675#M64811</link>
      <description>&lt;P&gt;I am also having the same issue in ArcGIS ArcPro 2.9, python 3.&lt;/P&gt;&lt;P&gt;I have a lyrx file and the ApplySymbologyFromLayer tool works from the python window and in a standalone script, but when I try to run it from a toolbox script it is not updating. Also, I am getting no errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 18:44:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/1185675#M64811</guid>
      <dc:creator>RebeccaKRansom</dc:creator>
      <dc:date>2022-06-23T18:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ApplySymbologyFromLayer in Python-script?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/1313119#M68279</link>
      <description>&lt;P&gt;Same issue.&amp;nbsp; Has anyone submitted a support ticket for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 15:30:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-applysymbologyfromlayer-in-python/m-p/1313119#M68279</guid>
      <dc:creator>KevinMayall</dc:creator>
      <dc:date>2023-07-28T15:30:46Z</dc:date>
    </item>
  </channel>
</rss>

