<?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.mangement.{tool} vs arcpy.{tool}_management What's the difference?! in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726700#M56366</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;‌ Dan, that makes perfect sense!&lt;/P&gt;&lt;P&gt;So, now I'm wondering why (regardless of the script tool) the tool works one way but not the other in Pro? I don't know if that's a bug or hints at one, or possibly that there is indeed something wrong with the inputs since&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;arcpy&lt;SPAN class=""&gt;.&lt;/SPAN&gt;management&lt;SPAN class=""&gt;.&lt;/SPAN&gt;SaveToLayerFile &lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/CODE&gt;Returns a 000622 error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I failed to answer one of Dan's original questions which was if the map project was open. When I run the code from the python window setting the aprx to 'CURRENT' it works fine. However...when I run the code in the python window from another map&amp;nbsp; project and set the aprx to the full file path of the &lt;EM&gt;closed&lt;/EM&gt; project, then I get the same error as in my script tool! So that's something there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Jan 2019 13:11:40 GMT</pubDate>
    <dc:creator>ZacharyHart</dc:creator>
    <dc:date>2019-01-18T13:11:40Z</dc:date>
    <item>
      <title>arcpy.SaveToLayerFile_Management 999999 Error</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726691#M56357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm seeing some different behavior here in ArcGIS Pro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this particular case I'm using&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SaveToLayerFile_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_layer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;out_layer&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;[Curiously, this works in the python command window but fails in a script tool].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;management&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SaveToLayerFile&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_layer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_layer&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the python window with the same parameters the tool fails with an 000622 error. I tried to supply the other optional parameters but it still failed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2019 14:53:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726691#M56357</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2019-01-17T14:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.mangement.{tool} vs arcpy.{tool}_management What's the difference?!</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726692#M56358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is ArcMap/ArcGIS Pro open or closed when you do this.&lt;/P&gt;&lt;P&gt;When you say the "python command window" which one?&lt;/P&gt;&lt;P&gt;When you sayt the "python window"&amp;nbsp; the one that is built into *map/*pro?&lt;/P&gt;&lt;P&gt;maybe a 'console' in a python IDE, like the IPython console in Spyder?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you specify what you used exactly as...&lt;/P&gt;&lt;P&gt;in_layer &amp;nbsp; &amp;nbsp; …. had you set your environments to work in a geodatabase? is *.map/*.pro open &amp;nbsp;&lt;/P&gt;&lt;P&gt;out_layer &amp;nbsp; …. was this a full path to a folder for a layer file (*.lyr or *.lyrx)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect that the in_layer and/or the out_layer can't be found because of the above conditions&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2019 16:47:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726692#M56358</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-01-17T16:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.mangement.{tool} vs arcpy.{tool}_management What's the difference?!</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726693#M56359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, yes...important clarifications. Sorry if i wasn't specific enough...I thought Esri was calling the 'python window' the built-in interface...well, at least that's what they called it in ArcMap. But yes: built-in interface in ArcGIS Pro...no console.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 separate issues but I'll focus on your questions first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I run the the code from the 'python window' the layer file is exported just fine...within the script tool it fails with a 999999 error. One thing to keep in mind here is that these inputs are used elsewhere in the script tool just fine. But let me try to pare this down to what's relevant here.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;#Import Modules&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; os

&lt;SPAN class="comment token"&gt;#Variables&lt;/SPAN&gt;
Date &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; time&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;strftime&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%m%d%Y"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
OutputFolder &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"D:\\TEMP"&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;##In the script tool this is exposed as a parameter and not hard-coded. &lt;/SPAN&gt;
LayerName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SoilsMUID_"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; Date &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".lyrx"&lt;/SPAN&gt;
ExportLayer &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;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;OutputFolder&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; LayerName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Setup Map Document Info&lt;/SPAN&gt;
aprx &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; &lt;SPAN class="comment token"&gt;##In the script tool, this points to an aprx file using the full path.&lt;/SPAN&gt;
map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listMaps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Soils"&lt;/SPAN&gt;&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;
SoilsLyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'SoilsMUID'&lt;/SPAN&gt;&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; &lt;SPAN class="comment token"&gt;##This layer's data source is a shapefile&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Export Layer File&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Exporting Layer File to {0}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ExportLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SaveToLayerFile_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SoilsLyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; ExportLayer&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the script tool (if the SaveToLayerFile is commented out), the tool goes on to select the in_layer, zoom to it, and some other stuff and then a PDF is exported no problem. &lt;/P&gt;&lt;P&gt;FWIW, I also tried to create a feature layer from SoilsLyr and then pass that to SaveToLayerFile_management (unneeded but worth a try) and that fails as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:04:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726693#M56359</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2021-12-12T07:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.mangement.{tool} vs arcpy.{tool}_management What's the difference?!</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726694#M56360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Layers can be referenced from within a project using the &lt;/SPAN&gt;&lt;SPAN style="background-color: transparent; color: #4c4c4c; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;listLayers&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt; method on the &lt;/SPAN&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/map-class.htm" style="background-color: transparent; color: #0074b8; font-family: &amp;amp;quot; avenir next w01&amp;amp;quot;,&amp;amp;quot;avenir next w00&amp;amp;quot;,&amp;amp;quot;avenir next&amp;amp;quot;,&amp;amp;quot;avenir&amp;amp;quot;,&amp;amp;quot;helvetica neue&amp;amp;quot;,sans-serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Map&lt;/A&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt; class or in a layer file (&lt;/SPAN&gt;&lt;SPAN style="background-color: transparent; color: #4c4c4c; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;.lyr&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt; or &lt;/SPAN&gt;&lt;SPAN style="background-color: transparent; color: #4c4c4c; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;.lyrx&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;) stored on disk using the &lt;/SPAN&gt;&lt;SPAN style="background-color: transparent; color: #4c4c4c; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;listLayers&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt; method on the &lt;/SPAN&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/layerfile-class.htm" style="background-color: transparent; color: #0074b8; font-family: &amp;amp;quot; avenir next w01&amp;amp;quot;,&amp;amp;quot;avenir next w00&amp;amp;quot;,&amp;amp;quot;avenir next&amp;amp;quot;,&amp;amp;quot;avenir&amp;amp;quot;,&amp;amp;quot;helvetica neue&amp;amp;quot;,sans-serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;LayerFile&lt;/A&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt; class.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Based on that description, I would want to ensure that the SoilsLyr is indeed a full path for a file one disk.&amp;nbsp; change line 15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; font-family: monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px #fff; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #999999; font-family: monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px #fff; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none #999999;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; font-family: monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px #fff; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;AddMessage&lt;/SPAN&gt;&lt;SPAN style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #999999; font-family: monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px #fff; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none #999999;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #669900; font-family: monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px #fff; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none #669900;"&gt;"Soils layer {0}\nExporting Layer File to {1}"&lt;/SPAN&gt;&lt;SPAN style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #999999; font-family: monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px #fff; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none #999999;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; font-family: monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px #fff; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #999999; font-family: monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px #fff; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none #999999;"&gt;(SoilsLyr, &lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; font-family: monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px #fff; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;ExportLayer&lt;/SPAN&gt;&lt;SPAN style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #999999; font-family: monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px #fff; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none #999999;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #999999; font-family: monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px #fff; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none #999999;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;BTW, you don't need the {0} {1}… ie sequential numbers unless you intend to alter the order... but it is fine, unless you miss a number, then you have to debug &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/laugh.png" /&gt;… just keep then sequential is easiest&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2019 18:37:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726694#M56360</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-01-17T18:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.mangement.{tool} vs arcpy.{tool}_management What's the difference?!</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726695#M56361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan, I didn't expect that it will return a full path for a file on disk since I'm using the listLayers method for a layer within the map. I modified the message per your request and got the following from the script tool.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/433619_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, if we comment out the SaveToLayerFile the script goes on to use SoilsLyr for several other things just fine so it sure seems the script has access to that as an input just fine?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByAttribute_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SoilsLyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
mf&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;zoomToAllLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByAttribute_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SoilsLyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"CLEAR_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
mf&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;camera&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;setExtent&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mf&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getLayerExtent&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SoilsLyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:04:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726695#M56361</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2021-12-12T07:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.mangement.{tool} vs arcpy.{tool}_management What's the difference?!</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726696#M56362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you humor me by trying to save to hardcoded:&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;ExportLayer = &lt;/CODE&gt;r'D:\TEMP\SoilsMUID_01172019.lyrx'&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2019 19:12:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726696#M56362</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2019-01-17T19:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.mangement.{tool} vs arcpy.{tool}_management What's the difference?!</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726697#M56363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I like your thinking in eliminating that, but that also failed with a 999999 error&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px;"&gt; (Curiously, looking up a 999999 error I expected it to say "This is the most informative error code ever!"...sadly it did not).&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2019 19:18:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726697#M56363</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2019-01-17T19:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.mangement.{tool} vs arcpy.{tool}_management What's the difference?!</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726698#M56364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;‌ I didn't expect this thread to morph like this so I should probably rename the title. &lt;/P&gt;&lt;P&gt;I'm still curious what the difference between&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;arcpy.mangement.{tool} vs arcpy.{tool}_management&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2019 20:01:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726698#M56364</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2019-01-17T20:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.mangement.{tool} vs arcpy.{tool}_management What's the difference?!</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726699#M56365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would have to look up the reason... someone posted it recently, but the former is 'more pythonic' in that conforms to the way most python packages work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;package, module function&lt;/P&gt;&lt;P&gt;ie numpy linalg lstsq …&amp;nbsp;&lt;/P&gt;&lt;P&gt;sometimes (so don't use arcpy as a good example) this represents a folder structure but more generally a namespace structure.&lt;/P&gt;&lt;P&gt;It is usually not that simple but I know that the least squares function is in the linear algrebra section of the numpy module&lt;/P&gt;&lt;P&gt;numpy doesn't use the numpy.(tool)_package approach... I think esri modified that namespace useage to make it easier for gis peeps.&lt;/P&gt;&lt;P&gt;I prefer&amp;nbsp; to think of arctools in this context&amp;nbsp; arcpy.toolbox.tool&amp;nbsp; with arcpy being a convenience to access tools in the toolbox namespace&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2019 21:35:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726699#M56365</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-01-17T21:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.mangement.{tool} vs arcpy.{tool}_management What's the difference?!</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726700#M56366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;‌ Dan, that makes perfect sense!&lt;/P&gt;&lt;P&gt;So, now I'm wondering why (regardless of the script tool) the tool works one way but not the other in Pro? I don't know if that's a bug or hints at one, or possibly that there is indeed something wrong with the inputs since&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;arcpy&lt;SPAN class=""&gt;.&lt;/SPAN&gt;management&lt;SPAN class=""&gt;.&lt;/SPAN&gt;SaveToLayerFile &lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/CODE&gt;Returns a 000622 error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I failed to answer one of Dan's original questions which was if the map project was open. When I run the code from the python window setting the aprx to 'CURRENT' it works fine. However...when I run the code in the python window from another map&amp;nbsp; project and set the aprx to the full file path of the &lt;EM&gt;closed&lt;/EM&gt; project, then I get the same error as in my script tool! So that's something there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2019 13:11:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726700#M56366</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2019-01-18T13:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.mangement.{tool} vs arcpy.{tool}_management What's the difference?!</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726701#M56367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;I'm still curious what the difference between &lt;SPAN style="font-size: 15px;"&gt;arcpy.mangement.{tool} vs arcpy.{tool}_management&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Both point back to the same compiled code.&amp;nbsp; There should not be a difference in how they handle the inputs.&amp;nbsp; If there is a difference, it is likely a bug.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# both reference same memory location&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SaveToLayerFile_management
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;function SaveToLayerFile at &lt;SPAN class="number token"&gt;0x7f9237a9bb70&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;management&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SaveToLayerFile
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;function SaveToLayerFile at &lt;SPAN class="number token"&gt;0x7f9237a9bb70&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# so both have same Python id&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; id&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SaveToLayerFile_management&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;140265975823216&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; id&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;management&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SaveToLayerFile&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;140265975823216&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:04:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726701#M56367</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-12T07:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.mangement.{tool} vs arcpy.{tool}_management What's the difference?!</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726702#M56368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3420"&gt;Joshua Bixby&lt;/A&gt;‌ this is very helpful from a diagnostic perspective. Thanks a bunch! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2019 18:19:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726702#M56368</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2019-01-18T18:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SaveToLayerFile_Management 999999 Error</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726703#M56369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3420" target="_blank"&gt;Joshua Bixby&lt;/A&gt;‌ &lt;A href="https://community.esri.com/migrated-users/3116" target="_blank"&gt;Dan Patterson&lt;/A&gt;‌ &lt;A href="https://community.esri.com/migrated-users/17314" target="_blank"&gt;Darren Wiens&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi everyone, I wanted to thank you for your help and also give you a bit of an update. Here's what I know to date:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Today Esri Support verified there was a bug for this tool.&lt;P&gt;&lt;STRONG&gt;BUG ID&lt;/STRONG&gt;:&amp;nbsp;BUG-000117445&lt;BR /&gt; &lt;STRONG&gt;Synopsis&lt;/STRONG&gt;:&amp;nbsp;The Save To Layer File management tool fails and returns Error 999999 when run from the Python IDLE window in ArcGIS Pro.&lt;BR /&gt; &lt;STRONG&gt;Status&lt;/STRONG&gt;:&amp;nbsp;New&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;We confirmed that this tool also fails when used in a script tool&lt;/LI&gt;&lt;LI&gt;The current &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/save-to-layer-file.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS Pro documentation&lt;/A&gt; is still outdated and referencing working with .lyr files.&lt;/LI&gt;&lt;LI&gt;I was able to find a workaround using&amp;nbsp;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/layer-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;'saveACopy' &lt;/A&gt; as part of the arcpy mapping module layer class.&lt;/LI&gt;&lt;LI&gt;Here is a quick example:&lt;/LI&gt;&lt;/UL&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;#Import Modules&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; os

&lt;SPAN class="comment token"&gt;#Variables&lt;/SPAN&gt;
Date &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; time&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;strftime&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%m%d%Y"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
OutputFolder &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"D:\\TEMP"&lt;/SPAN&gt;
LayerName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SoilsMUID_"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; Date &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".lyrx"&lt;/SPAN&gt;
ExportLayer &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;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;OutputFolder&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; LayerName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Setup Map Document Info&lt;/SPAN&gt;
aprx &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;"Path to your aprx file"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listMaps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Soils"&lt;/SPAN&gt;&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;
SoilsLyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'SoilsMUID'&lt;/SPAN&gt;&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; &lt;SPAN class="comment token"&gt;##This layer's data source is a shapefile&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Export Layer File&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Exporting Layer File to {0}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ExportLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
SoilsLyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;saveACopy&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ExportLayer&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:04:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726703#M56369</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2021-12-12T07:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SaveToLayerFile_Management 999999 Error</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726704#M56370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the update, this is useful not just to those who commented here, but anyone in the future who finds this thread.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2019 21:23:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-savetolayerfile-management-999999-error/m-p/726704#M56370</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-01-24T21:23:00Z</dc:date>
    </item>
  </channel>
</rss>

