<?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: Save To Layer File &amp;quot;Dataset does not exist or is not supported&amp;quot; error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/save-to-layer-file-amp-quot-dataset-does-not-exist/m-p/349623#M27417</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You don't need any of those quotes except around the "_layer". The below is all you need as long as your workspace is set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.SaveToLayerFile_management(inLayer, inLayer + "_layer")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Mar 2012 17:14:58 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2012-03-08T17:14:58Z</dc:date>
    <item>
      <title>Save To Layer File &amp;quot;Dataset does not exist or is not supported&amp;quot; error</title>
      <link>https://community.esri.com/t5/python-questions/save-to-layer-file-amp-quot-dataset-does-not-exist/m-p/349621#M27415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm fairly new to python and arcpy. I'm picking it up quickly, but I've hit a wall on a script I'm working on. Here's the issue:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to write a script to loop through each record in a feature class, export each record as a layer, save the layer as a layer file (so I can symbolize it), and then symbolize it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got this working fine in my "test" mode (without using variables); however, when I add variables to act as parameters for the tools I'm using, I run into a problem. Specifically, it's the &lt;/SPAN&gt;&lt;STRONG&gt;SaveToLayerFile_management()&lt;/STRONG&gt;&lt;SPAN&gt; tool that's giving me this error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...[previous code, see attachment for full code]...&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;arcpy.MakeFeatureLayer_management(srcFeature, inLayer, whereClause) #creates the layer based on crop type&lt;BR /&gt;arcpy.SaveToLayerFile_management("\"" + inLayer + "\"", "\"" + inLayer + "_layer\"") #should save the layer as croptype_layer. Syntax is fine as far as I can tell.&lt;BR /&gt;Runtime error &amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;: ERROR 000732: Input Layer: Dataset "Corn" does not exist or is not supported&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;"Corn" does exist! When I enter this into the python window...&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;arcpy.SaveToLayerFile_management("Corn", "Corn_layer")&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;...it recognizes "Corn" and runs it fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be very much appreciated. This is driving me crazy!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Cal&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;p.s. I'm running this code in the Python Window in ArcMap 10, if that matters.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 16:45:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/save-to-layer-file-amp-quot-dataset-does-not-exist/m-p/349621#M27415</guid>
      <dc:creator>CalvinGordon</dc:creator>
      <dc:date>2012-03-08T16:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Save To Layer File "Dataset does not exist or is not supported" error</title>
      <link>https://community.esri.com/t5/python-questions/save-to-layer-file-amp-quot-dataset-does-not-exist/m-p/349622#M27416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Turns out it &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;was&lt;/SPAN&gt;&lt;SPAN&gt; a syntax problem. I had the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SaveToLayerFile_management("\"" + inLayer + "\"", "\"" + inLayer + "_layer\"")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...but this turned out to be correct:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SaveToLayerFile_management(inLayer, inLayer) #Left off the '_layer' at the end&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Much simpler, no?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Cal&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 17:12:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/save-to-layer-file-amp-quot-dataset-does-not-exist/m-p/349622#M27416</guid>
      <dc:creator>CalvinGordon</dc:creator>
      <dc:date>2012-03-08T17:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Save To Layer File "Dataset does not exist or is not supported" error</title>
      <link>https://community.esri.com/t5/python-questions/save-to-layer-file-amp-quot-dataset-does-not-exist/m-p/349623#M27417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You don't need any of those quotes except around the "_layer". The below is all you need as long as your workspace is set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.SaveToLayerFile_management(inLayer, inLayer + "_layer")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 17:14:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/save-to-layer-file-amp-quot-dataset-does-not-exist/m-p/349623#M27417</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-03-08T17:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Save To Layer File "Dataset does not exist or is not supported" error</title>
      <link>https://community.esri.com/t5/python-questions/save-to-layer-file-amp-quot-dataset-does-not-exist/m-p/349624#M27418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In you SaveToLayerFile(), you do not specify an output directory:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.SaveToLayerFile_management("\"" + inLayer + "\"", "\"" + inLayer + "_layer\"")&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Try the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.SaveToLayerFile_management(inLayer, "C:/output/studyquadsLyr.lyr", "ABSOLUTE")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That might fix your issue.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 17:17:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/save-to-layer-file-amp-quot-dataset-does-not-exist/m-p/349624#M27418</guid>
      <dc:creator>AndrewChapkowski</dc:creator>
      <dc:date>2012-03-08T17:17:48Z</dc:date>
    </item>
  </channel>
</rss>

