<?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 ApplySymbologyFromLayer not working from a script tool but does work in python window in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/applysymbologyfromlayer-not-working-from-a-script/m-p/621231#M27618</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;--SCRIPT BELOW--&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;currentMap = arcpy.GetParameterAsText(0)&lt;BR /&gt;buildingGBD = arcpy.GetParameterAsText(1)&lt;BR /&gt;series = arcpy.GetParameterAsText(2)&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;aprxMap = aprx.listMaps(currentMap)[0]&lt;BR /&gt;lyrFile = r"Z:\Data\Series_10.lyrx"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for series_num in series.split(';'):&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;buildingFC = r"{0}\{1}\{2}{3}".format(buildingGBD,"Numbering", "Series_", series_num)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(buildingFC)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;try:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#aprxMap.addDataFromPath(buildingFC)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.management.ApplySymbologyFromLayer(buildingFC, lyrFile, None, "MAINTAIN")&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage("Series_" + series_num + " added")&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;except:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage("Series number does not exist")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the script tool I've brought into my model builder tool but when I try to use&amp;nbsp;&lt;SPAN&gt;arcpy.management.ApplySymbologyFromLayer instead of&amp;nbsp;aprxMap.addDataFromPath (which does work) so that I&amp;nbsp;can get the symbology, nothing gets added to the map frame. No errors are given and when I&amp;nbsp;run the same&amp;nbsp;arcpy.management.ApplySymbologyFromLayer in the python window it works. Is this a known bug or am I doing something&amp;nbsp;wrong. I am using Pro 2.6.0&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Sep 2020 18:00:39 GMT</pubDate>
    <dc:creator>SteveKoller</dc:creator>
    <dc:date>2020-09-29T18:00:39Z</dc:date>
    <item>
      <title>ApplySymbologyFromLayer not working from a script tool but does work in python window</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/applysymbologyfromlayer-not-working-from-a-script/m-p/621231#M27618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;--SCRIPT BELOW--&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;currentMap = arcpy.GetParameterAsText(0)&lt;BR /&gt;buildingGBD = arcpy.GetParameterAsText(1)&lt;BR /&gt;series = arcpy.GetParameterAsText(2)&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;aprxMap = aprx.listMaps(currentMap)[0]&lt;BR /&gt;lyrFile = r"Z:\Data\Series_10.lyrx"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for series_num in series.split(';'):&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;buildingFC = r"{0}\{1}\{2}{3}".format(buildingGBD,"Numbering", "Series_", series_num)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(buildingFC)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;try:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#aprxMap.addDataFromPath(buildingFC)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.management.ApplySymbologyFromLayer(buildingFC, lyrFile, None, "MAINTAIN")&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage("Series_" + series_num + " added")&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;except:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage("Series number does not exist")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the script tool I've brought into my model builder tool but when I try to use&amp;nbsp;&lt;SPAN&gt;arcpy.management.ApplySymbologyFromLayer instead of&amp;nbsp;aprxMap.addDataFromPath (which does work) so that I&amp;nbsp;can get the symbology, nothing gets added to the map frame. No errors are given and when I&amp;nbsp;run the same&amp;nbsp;arcpy.management.ApplySymbologyFromLayer in the python window it works. Is this a known bug or am I doing something&amp;nbsp;wrong. I am using Pro 2.6.0&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:00:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/applysymbologyfromlayer-not-working-from-a-script/m-p/621231#M27618</guid>
      <dc:creator>SteveKoller</dc:creator>
      <dc:date>2020-09-29T18:00:39Z</dc:date>
    </item>
  </channel>
</rss>

