<?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: Delete all Feature Layers in Memory in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/delete-all-feature-layers-in-memory/m-p/1154897#M64097</link>
    <description>&lt;P&gt;So, you want to get rid of interim files that you don't need anymore?&lt;/P&gt;&lt;P&gt;Create an empty list and append the interim files to it as they're created. Then run a FOR loop through the list, deleting each file in the list.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Mar 2022 16:46:20 GMT</pubDate>
    <dc:creator>AlfredBaldenweck</dc:creator>
    <dc:date>2022-03-17T16:46:20Z</dc:date>
    <item>
      <title>Delete all Feature Layers in Memory</title>
      <link>https://community.esri.com/t5/python-questions/delete-all-feature-layers-in-memory/m-p/1154894#M64096</link>
      <description>&lt;P&gt;I am running a script that has many Features added.&amp;nbsp; Up until now the script would run and then end and be done but I am adding a WHILE loop that reruns the script.&lt;/P&gt;&lt;P&gt;In this script there are a bunch of Feature Layers that get created like below.&lt;/P&gt;&lt;P&gt;At the end of the Script before it runs again I want to DELETE all of the FeatureLayers that were created in memory... Is there a call that will do the delete.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;target_lyr = arcpy.MakeFeatureLayer_management(os.path.join(db['Path'], layer), layer+'_exclude')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 16:40:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/delete-all-feature-layers-in-memory/m-p/1154894#M64096</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2022-03-17T16:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all Feature Layers in Memory</title>
      <link>https://community.esri.com/t5/python-questions/delete-all-feature-layers-in-memory/m-p/1154897#M64097</link>
      <description>&lt;P&gt;So, you want to get rid of interim files that you don't need anymore?&lt;/P&gt;&lt;P&gt;Create an empty list and append the interim files to it as they're created. Then run a FOR loop through the list, deleting each file in the list.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 16:46:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/delete-all-feature-layers-in-memory/m-p/1154897#M64097</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2022-03-17T16:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all Feature Layers in Memory</title>
      <link>https://community.esri.com/t5/python-questions/delete-all-feature-layers-in-memory/m-p/1154899#M64098</link>
      <description>&lt;P&gt;Try this (for each layer):&lt;/P&gt;&lt;LI-CODE lang="c"&gt; arcpy.Delete_management(target_lyr)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 16:47:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/delete-all-feature-layers-in-memory/m-p/1154899#M64098</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2022-03-17T16:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all Feature Layers in Memory</title>
      <link>https://community.esri.com/t5/python-questions/delete-all-feature-layers-in-memory/m-p/1154923#M64099</link>
      <description>&lt;P&gt;Yea I was thinking that....but was wondering if at the end of the script I could just DELETE ALL or something like that...like clearing the Cache on your browser&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 17:32:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/delete-all-feature-layers-in-memory/m-p/1154923#M64099</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2022-03-17T17:32:11Z</dc:date>
    </item>
  </channel>
</rss>

