<?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: SaveToLayerFile_management function and symbology in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646512#M50389</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alain, could you format your code&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Sep 2018 12:32:27 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2018-09-19T12:32:27Z</dc:date>
    <item>
      <title>SaveToLayerFile_management function and symbology</title>
      <link>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646511#M50388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all. I'm in trouble with the SaveToLayerFile_management function in a python script for arcgis pro 2.1.2. The script is setting a symbology that works but happens to not beeing saved on disk. I mean the lyrx file is done but doesn't contain the symbology. I've tried many changes in vain. The code below works properly on the python console however. For info, I changed here somes values initially gotten with GetParameterAsText.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Ws&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace
Mxd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISProject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Current"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
MapPath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Mxd&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;filePath
ActMap &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Mxd&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;activeMap
LyrName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Benzene'&lt;/SPAN&gt;
SeuilsNb &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;
Seuils &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"10;580"&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;#string vers list&lt;/SPAN&gt;
fileName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;basename&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;MapPath&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fileNameLen &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fileName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;
Ws &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; MapPath&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;fileNameLen&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
in_layer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ActMap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LyrName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
LayerSource &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; in_layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dataSource
TargetFolder &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"J:\\00-Template-job_Oct2017\\900_CAD_GIS\\Lyr"&lt;/SPAN&gt;
Labels &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; Seuil &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; Seuils&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; Seuil &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; Seuils&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
 Labels&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Inférieur à "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; Seuil&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 BorneInf &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Seuil
 &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
 Labels&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;BorneInf &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" à "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; Seuil&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 BorneInf &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Seuil

Symbologie &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; in_layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;symbology
Symbologie&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRenderer&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'GraduatedColorsRenderer'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
Symbologie&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;renderer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;classificationField &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'result_value_atof'&lt;/SPAN&gt;
Symbologie&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;renderer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;breakCount &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; SeuilsNb
i &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; bc &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; Symbologie&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;renderer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;classBreaks&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
 bc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;upperBound &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; float&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Seuils&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 bc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;label &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Labels&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
 i &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;
in_layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;symbology &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Symbologie

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SaveToLayerFile_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LyrName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;TargetFolder&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; LyrName &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".lyrx"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks in advance for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:26:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646511#M50388</guid>
      <dc:creator>ALAINmartineau</dc:creator>
      <dc:date>2021-12-12T03:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: SaveToLayerFile_management function and symbology</title>
      <link>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646512#M50389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alain, could you format your code&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 12:32:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646512#M50389</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-09-19T12:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: SaveToLayerFile_management function and symbology</title>
      <link>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646513#M50390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without dissecting your paths, are they in the same location? if not, you might want to explore the absolute/relative option to see if that is an issue or has an effect&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/save-to-layer-file.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/save-to-layer-file.htm"&gt;Save To Layer File—Data Management toolbox | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 12:36:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646513#M50390</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-09-19T12:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: SaveToLayerFile_management function and symbology</title>
      <link>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646514#M50391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dan. Thanks for helping. Unfortunatly, adding an "absolute" or "relative" parameter doesn't help.&amp;nbsp;However I can say&amp;nbsp;one thing more I can't explain eather, If I run the code twice, the symbology disappear on arcgis but the lyrx file is this time complete&amp;nbsp;:-). Does that make sens for you?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 15:09:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646514#M50391</guid>
      <dc:creator>ALAINmartineau</dc:creator>
      <dc:date>2018-09-19T15:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: SaveToLayerFile_management function and symbology</title>
      <link>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646515#M50392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;strange... but nice work around &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 19:28:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646515#M50392</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-09-19T19:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: SaveToLayerFile_management function and symbology</title>
      <link>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646516#M50393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I kept trying to solve the issue in many ways. Result still consists on a file without my symbology. If running the program twice helps writing a complete lyrx file , may be the layer cache could be responsible. Is there a direct way to programaticly clear a layer cache? (since the updateConnectionProperties function is not exactly a success here)..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2018 08:34:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646516#M50393</guid>
      <dc:creator>ALAINmartineau</dc:creator>
      <dc:date>2018-09-25T08:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: SaveToLayerFile_management function and symbology</title>
      <link>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646517#M50394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you would have to search help using 'cache' for what can have a cache, and how to set or get rid of them.&lt;/P&gt;&lt;P&gt;This is the help topic for layer properties, where they talk about caching ...&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/help/mapping/layer-properties/set-layer-properties.htm" title="http://pro.arcgis.com/en/pro-app/help/mapping/layer-properties/set-layer-properties.htm"&gt;Set layer properties—ArcGIS Pro | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you might try the approach, but whether there is arcpy access I haven't looked&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/help/mapping/layer-properties/set-layer-properties.htm" title="http://pro.arcgis.com/en/pro-app/help/mapping/layer-properties/set-layer-properties.htm"&gt;Set layer properties—ArcGIS Pro | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2018 09:01:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646517#M50394</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-09-25T09:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: SaveToLayerFile_management function and symbology</title>
      <link>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646518#M50395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://www.exprodat.com/blogs/creating-layer-files-with-python-4/"&gt;https://www.exprodat.com/blogs/creating-layer-files-with-python-4/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this worked for my in pycharm.&amp;nbsp; i used the arcpy.mp module and lyrx layer files.&amp;nbsp; I also referenced a path to my aprx project.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 19:11:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/646518#M50395</guid>
      <dc:creator>ChrisWiebke</dc:creator>
      <dc:date>2019-05-09T19:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: SaveToLayerFile_management function and symbology</title>
      <link>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/1337875#M68954</link>
      <description>&lt;DIV&gt;&lt;P&gt;This worked for me...&amp;nbsp; have fun!!&amp;nbsp; new reply&amp;nbsp; &amp;nbsp;old thread..&lt;/P&gt;&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;p2 = arcpy.mp.ArcGISProject(aprfilenew)&lt;BR /&gt;maps = p2.listMaps()&lt;BR /&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;map &lt;SPAN&gt;in &lt;/SPAN&gt;maps:&lt;BR /&gt;    &lt;SPAN&gt;print &lt;/SPAN&gt;(&lt;SPAN&gt;'--------------------------------------------------------------'&lt;/SPAN&gt;)&lt;BR /&gt;    &lt;SPAN&gt;print &lt;/SPAN&gt;(map.name)&lt;BR /&gt;    &lt;SPAN&gt;print &lt;/SPAN&gt;(&lt;SPAN&gt;'--------------------------------------------------------------'&lt;/SPAN&gt;)&lt;BR /&gt;    layers = map.listLayers()&lt;BR /&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;layer &lt;SPAN&gt;in &lt;/SPAN&gt;layers:&lt;BR /&gt;        &lt;SPAN&gt;if &lt;/SPAN&gt;layer.supports(&lt;SPAN&gt;'NAME'&lt;/SPAN&gt;) &lt;SPAN&gt;and &lt;/SPAN&gt;layer.supports(&lt;SPAN&gt;'LONGNAME'&lt;/SPAN&gt;) \&lt;BR /&gt;                    &lt;SPAN&gt;and &lt;/SPAN&gt;layer.supports(&lt;SPAN&gt;'DATASOURCE'&lt;/SPAN&gt;):&lt;BR /&gt;            &lt;SPAN&gt;print &lt;/SPAN&gt;(layer.longName + &lt;SPAN&gt;' ---&amp;gt; ' &lt;/SPAN&gt;+ layer.dataSource)&lt;BR /&gt;        &lt;SPAN&gt;print&lt;/SPAN&gt;(layer.longName)&lt;BR /&gt;&lt;BR /&gt;        newfeaturelayer = layer.longName&lt;BR /&gt;        arcpy.MakeFeatureLayer_management(layer&lt;SPAN&gt;, &lt;/SPAN&gt;newfeaturelayer)&lt;BR /&gt;        newLayerout = newfeaturelayer + &lt;SPAN&gt;"-az"  &lt;/SPAN&gt;&lt;SPAN&gt;# ## rename this as needed....&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;        arcpy.ApplySymbologyFromLayer_management(newfeaturelayer&lt;SPAN&gt;, &lt;/SPAN&gt;layer)&lt;BR /&gt;&lt;BR /&gt;        arcpy.SaveToLayerFile_management(newfeaturelayer&lt;SPAN&gt;, &lt;/SPAN&gt;path + newLayerout + &lt;SPAN&gt;'.lyrx'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"ABSOLUTE"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Oct 2023 18:14:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/savetolayerfile-management-function-and-symbology/m-p/1337875#M68954</guid>
      <dc:creator>SGTomlins</dc:creator>
      <dc:date>2023-10-13T18:14:57Z</dc:date>
    </item>
  </channel>
</rss>

