<?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>idea Update Symbology in ArcPro using a Stand Alone Script in ArcGIS Pro Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-ideas/update-symbology-in-arcpro-using-a-stand-alone/idi-p/1065325</link>
    <description>&lt;P&gt;When running the code below in ArcPro python window it works, but when ran in a stand alone script read into ArcPro it doesn't work...After talking with ESRI support, in order to change symbology the code has to be ran directly in the python window of ArcPro in order for it to work. That ArcPro doesn't have this capability just yet for it to be ran through a stand alone script. If you can look into this and make a stand alone script be able to run the arcpy.management.ApplySymbologyFromLayer(lyr, sym) that would be great!!!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for lyr in active_map.listLayers():&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if lyr.name == "Parcel_Buffer":&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sym = os.path.join(lyr_directory, "Parcel_Buffer_ArcGISPro.lyrx")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; arcpy.management.ApplySymbologyFromLayer(lyr, sym)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;elif lyr.name == "Parcel_Selection":&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sym = os.path.join(lyr_directory, "Selected_Parcel_ArcGISPro.lyrx")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; arcpy.management.ApplySymbologyFromLayer(lyr, sym)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;elif lyr.name == "Parcels_in_Buffer":&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sym = os.path.join(lyr_directory, "Parcel_Buffer_Intersect.lyrx")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; arcpy.management.ApplySymbologyFromLayer(lyr, sym)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;elif lyr.name == "Parcels_Sorted":&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sym = os.path.join(lyr_directory, "Sorted_Parcels_ArcGISPro.lyrx")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; arcpy.management.ApplySymbologyFromLayer(lyr, sym)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "No symbol file for specified layer"&lt;/P&gt;&lt;P&gt;aprx.save()&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 15:13:08 GMT</pubDate>
    <dc:creator>RMiller</dc:creator>
    <dc:date>2024-04-03T15:13:08Z</dc:date>
    <item>
      <title>Update Symbology in ArcPro using a Stand Alone Script</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/update-symbology-in-arcpro-using-a-stand-alone/idi-p/1065325</link>
      <description>&lt;P&gt;When running the code below in ArcPro python window it works, but when ran in a stand alone script read into ArcPro it doesn't work...After talking with ESRI support, in order to change symbology the code has to be ran directly in the python window of ArcPro in order for it to work. That ArcPro doesn't have this capability just yet for it to be ran through a stand alone script. If you can look into this and make a stand alone script be able to run the arcpy.management.ApplySymbologyFromLayer(lyr, sym) that would be great!!!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for lyr in active_map.listLayers():&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if lyr.name == "Parcel_Buffer":&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sym = os.path.join(lyr_directory, "Parcel_Buffer_ArcGISPro.lyrx")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; arcpy.management.ApplySymbologyFromLayer(lyr, sym)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;elif lyr.name == "Parcel_Selection":&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sym = os.path.join(lyr_directory, "Selected_Parcel_ArcGISPro.lyrx")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; arcpy.management.ApplySymbologyFromLayer(lyr, sym)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;elif lyr.name == "Parcels_in_Buffer":&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sym = os.path.join(lyr_directory, "Parcel_Buffer_Intersect.lyrx")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; arcpy.management.ApplySymbologyFromLayer(lyr, sym)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;elif lyr.name == "Parcels_Sorted":&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sym = os.path.join(lyr_directory, "Sorted_Parcels_ArcGISPro.lyrx")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; arcpy.management.ApplySymbologyFromLayer(lyr, sym)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "No symbol file for specified layer"&lt;/P&gt;&lt;P&gt;aprx.save()&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 15:13:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/update-symbology-in-arcpro-using-a-stand-alone/idi-p/1065325</guid>
      <dc:creator>RMiller</dc:creator>
      <dc:date>2024-04-03T15:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Update Symbology in ArcPro using a Stand Alone Script</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/update-symbology-in-arcpro-using-a-stand-alone/idc-p/1066364#M29207</link>
      <description>&lt;P&gt;Is this what you want?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os
import arcpy

aprx = arcpy.mp.ArcGISProject("path\to\your\project.aprx")
active_map = aprx.listMaps("MapName")[0]
lyr_directory = "..."
for lyr in active_map.listLayers():
    # etc
aprx.save()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, you could rewrite your code like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;symbol_layers = {
    "Parcel_Buffer": "Parcel_Buffer_ArcGISPro.lyrx",
    "Parcel_Selection": "Selected_Parcel_ArcGISPro.lyrx",
    # ...
}
for lyr in active_map.listLayers():
    try:
        sym = os.path.join(lyr_directory, symbol_layers[lyr.name])
        arcpy.management.ApplySymbologyFromLayer(lyr, sym)
    except KeyError:
        print("No symbol file for layer {}".format(lyr.name))&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 09 Jun 2021 14:02:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/update-symbology-in-arcpro-using-a-stand-alone/idc-p/1066364#M29207</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-06-09T14:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Update Symbology in ArcPro using a Stand Alone Script</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/update-symbology-in-arcpro-using-a-stand-alone/idc-p/1066487#M29208</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for commenting. I setup a python tool in ArcPro and I am running my script as a stand alone script. When I run my tool that's tied to my script it runs great with no errors. The only problem is that the symbology part doesn't actually change the symbology in the map. When I run my same script through the ArcPro window it will change the symbology in the map. I called ESRI support and they tried to look at it. That's when they told me to submit it as an idea because the symbology part doesn't work in a stand alone script right at this moment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did take the second part you sent and tried restructuring my symbology code in the script. It runs great with no errors in my stand alone script but still no luck of it actually changing the symbology in the map.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 17:22:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/update-symbology-in-arcpro-using-a-stand-alone/idc-p/1066487#M29208</guid>
      <dc:creator>RMiller</dc:creator>
      <dc:date>2021-06-09T17:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Update Symbology in ArcPro using a Stand Alone Script</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/update-symbology-in-arcpro-using-a-stand-alone/idc-p/1066798#M29209</link>
      <description>&lt;P&gt;Ah, now I get it...&lt;/P&gt;&lt;P&gt;can confirm that&lt;/P&gt;&lt;P&gt;changing the symbology WORKS when&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;running the script outside of ArcGIS (e.g. executing it in IDLE)&lt;/LI&gt;&lt;LI&gt;running the script in ArcGIS in the python window (either by copy/pasting or by importing the script)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;changing the symbology DOES NOT WORK when&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;running the script as script tool&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 10 Jun 2021 09:08:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/update-symbology-in-arcpro-using-a-stand-alone/idc-p/1066798#M29209</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-06-10T09:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Update Symbology in ArcPro using a Stand Alone Script</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/update-symbology-in-arcpro-using-a-stand-alone/idc-p/1097522#M29210</link>
      <description>&lt;P&gt;This was a bug that was apparently fixed....but never was (alongside the 're-use maps' option when importing a Layout_&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 03:40:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/update-symbology-in-arcpro-using-a-stand-alone/idc-p/1097522#M29210</guid>
      <dc:creator>GeoNZ</dc:creator>
      <dc:date>2021-09-13T03:40:03Z</dc:date>
    </item>
  </channel>
</rss>

