<?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: FeatureClassToShapefile_conversion fails when input is featurelayer in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/featureclasstoshapefile-conversion-fails-when/m-p/1051269#M60895</link>
    <description>&lt;P&gt;I believe you need to use Copy management to create a shapefile or feature class.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/make-feature-layer.htm" target="_self"&gt;Make Feature Layer (Data Management)&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;The temporary feature layer can be saved as a layer file using the Save To Layer File tool or can be saved as a new feature class using the Copy Features tool.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Apr 2021 12:23:43 GMT</pubDate>
    <dc:creator>MarkKinnaman</dc:creator>
    <dc:date>2021-04-26T12:23:43Z</dc:date>
    <item>
      <title>FeatureClassToShapefile_conversion fails when input is featurelayer</title>
      <link>https://community.esri.com/t5/python-questions/featureclasstoshapefile-conversion-fails-when/m-p/1050562#M60881</link>
      <description>&lt;P&gt;Im trying to create a shapefile with input from a featurelayer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it fails with:&lt;/P&gt;&lt;P&gt;WARNING: Failed to convert: MyLayer. ERROR 000210: Cannot create output c:\temp\Shapes\MyLayer.shp&lt;BR /&gt;Failed to execute (CopyFeatures).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;fc = r"c:\connections\MyEditor@MyDb.sde\mydb.measurement.Line"
arcpy.MakeFeatureLayer_management(fc,"MyLayer")
print(arcpy.GetCount_management("MyLayer"))
arcpy.FeatureClassToShapefile_conversion("MyLayer", "c:\\temp\\Shapes") #&amp;lt;-- This fails

#If I in the FeatureClassToShapefile_conversion uses the featureclass instead of the featurlayer it works.

arcpy.FeatureClassToShapefile_conversion(fc, "c:\\temp\\Shapes") #&amp;lt;-- This works&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What can I be doing wrong? The count returns&amp;nbsp;420504 so the featuerlayer contains data&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 09:44:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/featureclasstoshapefile-conversion-fails-when/m-p/1050562#M60881</guid>
      <dc:creator>leonoestergaard</dc:creator>
      <dc:date>2021-04-23T09:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureClassToShapefile_conversion fails when input is featurelayer</title>
      <link>https://community.esri.com/t5/python-questions/featureclasstoshapefile-conversion-fails-when/m-p/1050576#M60883</link>
      <description>&lt;P&gt;I suspect it can't find "MyLayer" since it doesn't know where it is, I don't think you "fc" plus "MyLayer" makes an actual layer file.&amp;nbsp; It needs a workspace, then the layer name&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/make-feature-layer.htm" target="_blank"&gt;Make Feature Layer (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would probably work if you created a *.lyrx file (a layer file) with a path.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 11:13:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/featureclasstoshapefile-conversion-fails-when/m-p/1050576#M60883</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-04-23T11:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureClassToShapefile_conversion fails when input is featurelayer</title>
      <link>https://community.esri.com/t5/python-questions/featureclasstoshapefile-conversion-fails-when/m-p/1050579#M60884</link>
      <description>&lt;P&gt;Well, just tried to run the same code in python3 and it works...&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 11:23:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/featureclasstoshapefile-conversion-fails-when/m-p/1050579#M60884</guid>
      <dc:creator>leonoestergaard</dc:creator>
      <dc:date>2021-04-23T11:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureClassToShapefile_conversion fails when input is featurelayer</title>
      <link>https://community.esri.com/t5/python-questions/featureclasstoshapefile-conversion-fails-when/m-p/1050582#M60885</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/layer-properties.htm" target="_blank"&gt;Layer properties—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;would be a good check prior to using a feature layer.&lt;/P&gt;&lt;P&gt;python3? all pro tools have to use python 3&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 11:31:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/featureclasstoshapefile-conversion-fails-when/m-p/1050582#M60885</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-04-23T11:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureClassToShapefile_conversion fails when input is featurelayer</title>
      <link>https://community.esri.com/t5/python-questions/featureclasstoshapefile-conversion-fails-when/m-p/1051199#M60891</link>
      <description>&lt;P&gt;It works on python27 with arcgis 10.6&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 06:35:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/featureclasstoshapefile-conversion-fails-when/m-p/1051199#M60891</guid>
      <dc:creator>leonoestergaard</dc:creator>
      <dc:date>2021-04-26T06:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureClassToShapefile_conversion fails when input is featurelayer</title>
      <link>https://community.esri.com/t5/python-questions/featureclasstoshapefile-conversion-fails-when/m-p/1051269#M60895</link>
      <description>&lt;P&gt;I believe you need to use Copy management to create a shapefile or feature class.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/make-feature-layer.htm" target="_self"&gt;Make Feature Layer (Data Management)&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;The temporary feature layer can be saved as a layer file using the Save To Layer File tool or can be saved as a new feature class using the Copy Features tool.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 12:23:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/featureclasstoshapefile-conversion-fails-when/m-p/1051269#M60895</guid>
      <dc:creator>MarkKinnaman</dc:creator>
      <dc:date>2021-04-26T12:23:43Z</dc:date>
    </item>
  </channel>
</rss>

