<?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: Model Builder Delete Feature Class problem in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104278#M3577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi brenth, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please can you share your model or a snapshot of your model so see what you are doing? You are trying to connect the output of which tool to the delete tool?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Apr 2012 18:14:13 GMT</pubDate>
    <dc:creator>ShitijMehta</dc:creator>
    <dc:date>2012-04-20T18:14:13Z</dc:date>
    <item>
      <title>Model Builder Delete Feature Class problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104275#M3574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How do I add the Delete tool to my Model if the feature class doesn't exist?&amp;nbsp; It will be unknown at runtime whether the feature class will exist and I want it to delete the feature class if it does exist.&amp;nbsp; However it seems that I can only add the Delete tool if the feature class exists.&amp;nbsp; How do you experts get around this "bug/feature"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 14:37:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104275#M3574</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2012-04-20T14:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Delete Feature Class problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104276#M3575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can put in some if-then-else logic in your model using either the Calculate Value tool or a script tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Check this series of blogs:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2011/06/06/modelbuilderifthenelse1/"&gt;If you are stuck at "if" �?? Part 1&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2011/06/06/modelbuilderifthenelse2/"&gt;If you are stuck at "if" �?? Part 2 �?? Example of using Script tool to create branches using if-else logic&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2011/09/12/modelbuilderifthenelse3/"&gt;If you are stuck at "if" �?? Part 3 �?? Does Extension Exists model example&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2011/09/20/modelbuilderifthenelse4/"&gt;If you are stuck at "if" �?? Part 4 �?? Does Selection Exists model example&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Create a dummy feature class in the place where your feature class could exists or not (location) such the your feature class exists. Run the model once based on this blog&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2011/06/06/modelbuilderifthenelse1/"&gt;If you are stuck at "if" �?? Part 1&lt;/A&gt;&lt;SPAN&gt;. This blog has an example for your case.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Once your model validates and runs for your dummy feature class. You can save the model and run it from its tool dialog. You will have to experiment a little with your model as I do not really know besides the delete what are the other tools in your model.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 15:35:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104276#M3575</guid>
      <dc:creator>ShitijMehta</dc:creator>
      <dc:date>2012-04-20T15:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Delete Feature Class problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104277#M3576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The "if" is not the problem.&amp;nbsp; I can already say whether the Feature Class exists or not, but that doesn't help me at Design Time when I can't even add the tool becaus the Feature Class doesn't exist.&amp;nbsp; Is there an "If" that works at design time and lets you add tools without some valid arguments?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 16:01:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104277#M3576</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2012-04-20T16:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Delete Feature Class problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104278#M3577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi brenth, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please can you share your model or a snapshot of your model so see what you are doing? You are trying to connect the output of which tool to the delete tool?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 18:14:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104278#M3577</guid>
      <dc:creator>ShitijMehta</dc:creator>
      <dc:date>2012-04-20T18:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Delete Feature Class problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104279#M3578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I attached the simplest model that breaks.&amp;nbsp; Here is the code inside "Conditional Delete".&amp;nbsp; It will not even start if the feature class doesn't exist, but the whole point of the script is to see if the feature class exists first.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import sys, os, arcpy

# Get the input from the model
InputFC = arcpy.GetParameterAsText(0)


# Statement to check the existence of the feature class
if arcpy.Exists(InputFC):
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Feature Class Exists and will be deleted!")
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(InputFC, "FeatureClass")
arcpy.SetParameterAsText(1,"True")
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:23:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104279#M3578</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2021-12-11T06:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Delete Feature Class problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104280#M3579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Create a dummy feature class in the place where your feature class could exists or not (location) such the your feature class exists. Run the model once based on this blog&lt;BR /&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2011/06/06/modelbuilderifthenelse1/"&gt;If you are stuck at "if" �?? Part 1&lt;/A&gt;. This blog has an example for your case.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Off topic.&amp;nbsp; Have you tested your "If Feature Class Exists" on this blog with SDE layers?&amp;nbsp; I get false even if the feature class does exist (my other similar scripts return true with the same info).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 19:24:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104280#M3579</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2012-04-20T19:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Delete Feature Class problem</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104281#M3580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;One way to get it done is to make the input parameter of the script tool optional and make the output parameter derived.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 19:31:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-delete-feature-class-problem/m-p/104281#M3580</guid>
      <dc:creator>NobbirAhmed</dc:creator>
      <dc:date>2012-04-20T19:31:29Z</dc:date>
    </item>
  </channel>
</rss>

