<?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 Empy feature class in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/empy-feature-class/m-p/390658#M30873</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't figure out why i am getting an empty feature class after i delete features, add field and calulate and delete empty features. I would appreciate some help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Taxparcels = "C:/Temp/Scratchworkspace.gdb/TaxParcels1"

PT = "Taxparce1s"
arcpy.MakeFeatureLayer_management(Taxparcels, PT)

########################################
# Process: Select Layer By Attribute to remove Q accounts
arcpy.SelectLayerByAttribute_management(PT, "NEW_SELECTION", "\"PIN\" LIKE 'Q%'")

# Process: Delete Features
if int(arcpy.GetCount_management(PT).getOutput(0)) &amp;gt; 0:
    arcpy.DeleteFeatures_management(PT)

#arcpy.DeleteField_management(PT, ["ACRES"])

PT1 = "Taxparcels1"
arcpy.MakeFeatureLayer_management(PT, PT1)


arcpy.FeatureClassToFeatureClass_conversion(PT1, "C:\Temp\Scratchworkspace.gdb", "TEST")‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 17:54:55 GMT</pubDate>
    <dc:creator>CCWeedcontrol</dc:creator>
    <dc:date>2021-12-11T17:54:55Z</dc:date>
    <item>
      <title>Empy feature class</title>
      <link>https://community.esri.com/t5/python-questions/empy-feature-class/m-p/390658#M30873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't figure out why i am getting an empty feature class after i delete features, add field and calulate and delete empty features. I would appreciate some help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Taxparcels = "C:/Temp/Scratchworkspace.gdb/TaxParcels1"

PT = "Taxparce1s"
arcpy.MakeFeatureLayer_management(Taxparcels, PT)

########################################
# Process: Select Layer By Attribute to remove Q accounts
arcpy.SelectLayerByAttribute_management(PT, "NEW_SELECTION", "\"PIN\" LIKE 'Q%'")

# Process: Delete Features
if int(arcpy.GetCount_management(PT).getOutput(0)) &amp;gt; 0:
    arcpy.DeleteFeatures_management(PT)

#arcpy.DeleteField_management(PT, ["ACRES"])

PT1 = "Taxparcels1"
arcpy.MakeFeatureLayer_management(PT, PT1)


arcpy.FeatureClassToFeatureClass_conversion(PT1, "C:\Temp\Scratchworkspace.gdb", "TEST")‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:54:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/empy-feature-class/m-p/390658#M30873</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2021-12-11T17:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Empy feature class</title>
      <link>https://community.esri.com/t5/python-questions/empy-feature-class/m-p/390659#M30874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I modified the code to this but i am still getting empty features...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Taxparcels = "C:/Temp/Scratchworkspace.gdb/TaxParcels1"

mem_fc = arcpy.CopyFeatures_management(Taxparcels, r"in_memory\TaxPar")
fl = arcpy.MakeFeatureLayer_management(mem_fc, "TaxPar")

query = "PIN LIKE 'Q%'"
arcpy.SelectLayerByAttribute_management(fl, "NEW_SELECTION", query)
if int(arcpy.GetCount_management(fl).getOutput(0)) &amp;gt; 0:
    arcpy.DeleteFeatures_management(fl)

arcpy.FeatureClassToFeatureClass_conversion(fl, "C:/Temp/Scratchworkspace.gdb", "TEST")

‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:54:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/empy-feature-class/m-p/390659#M30874</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2021-12-11T17:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Empy feature class</title>
      <link>https://community.esri.com/t5/python-questions/empy-feature-class/m-p/390660#M30875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After some further investigating i found the issue was with arcpy.env.preserveGlobalIDs.&lt;/P&gt;&lt;P&gt;I had this at the top of my script :arcpy.env.preserveGlobalIds = True: I am not sure why it worked after removing this line.&lt;/P&gt;&lt;P&gt;Why would this create&amp;nbsp; an empty feature class? The original feature class did not have GlobalIds.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2019 17:22:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/empy-feature-class/m-p/390660#M30875</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2019-03-01T17:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Empy feature class</title>
      <link>https://community.esri.com/t5/python-questions/empy-feature-class/m-p/390661#M30876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So it's working now, correct?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a love hate thing for Global IDs: love 'em for replication.&amp;nbsp; Hate 'em if they are used for anything else....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2019 17:30:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/empy-feature-class/m-p/390661#M30876</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-03-01T17:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Empy feature class</title>
      <link>https://community.esri.com/t5/python-questions/empy-feature-class/m-p/390662#M30877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes i am good, but still wondering why having arcpy.env.preserveGlobalIds = True would cause an empty feature class.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2019 20:59:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/empy-feature-class/m-p/390662#M30877</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2019-03-01T20:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Empy feature class</title>
      <link>https://community.esri.com/t5/python-questions/empy-feature-class/m-p/390663#M30878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A straight shot from hip....&amp;nbsp; Probably has something to do with the fact that you don't have Global IDs to preserve, and things got goofy on you...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2019 23:05:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/empy-feature-class/m-p/390663#M30878</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-03-01T23:05:43Z</dc:date>
    </item>
  </channel>
</rss>

