<?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: If then statement for python in Transportation Questions</title>
    <link>https://community.esri.com/t5/transportation-questions/if-then-statement-for-python/m-p/616201#M2048</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Wouldn't the arcpy.FeatureEnvelopeToPolygon_management need to be indented within the if statement?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not necessarily.&amp;nbsp; For example, if this variable you are wanting to overwrite does not exist, a new variable will not be created to replace it since the if block will only execute if that variable exists in the first place.&amp;nbsp; Are you using the if statement to test if the output variable exists, and if it does you want to delete it?&amp;nbsp; If you take the new variable (the result of the create envelopes tool) out of the if block, a variable will be created every time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jan 2013 01:18:23 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2013-01-23T01:18:23Z</dc:date>
    <item>
      <title>If then statement for python</title>
      <link>https://community.esri.com/t5/transportation-questions/if-then-statement-for-python/m-p/616196#M2043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: luke.kaim&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I am not understanding the logic, but what I want to do is make an if then statement. I want to create a file and then create another file. The code creates the first file, but does not create the second file. What am I doing wrong? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def main():
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy, sys, traceback, os, string, locale,arcgisscripting
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.overwriteOutput = True
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from arcpy import env
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; env.workspace =r"C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar"

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outputVGIboundingbox= "VGIboundingbox.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outputGNISboundingbox="GNISboundingbox.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VGIFile = r"C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar\polygon.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GNIS_FC = r"C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar\GNIS.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(outputVGIboundingbox):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(outputVGIboundingbox)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VGIboundingbox= arcpy.FeatureEnvelopeToPolygon_management(VGIFile,outputVGIboundingbox,"MULTIPART")

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif arcpy.Exists(outputGNISboundingbox):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(outputGNISboundingbox)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GNISboundingbox= arcpy.FeatureEnvelopeToPolygon_management(GNIS_Geom,outputGNISboundingbox,"MULTIPART")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Luke Kaim&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Luke Kaim (SIE)&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="mailto:Lucas.Kaim@maine.edu" rel="nofollow noopener noreferrer" target="_blank"&gt;Lucas.Kaim@maine.edu&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;(914)263-7866&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Don�??t complain. Just work harder" (Randy Pausch).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:20:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/if-then-statement-for-python/m-p/616196#M2043</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T02:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: If then statement for python</title>
      <link>https://community.esri.com/t5/transportation-questions/if-then-statement-for-python/m-p/616197#M2044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Caleb1987&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; Hi Everyone,&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;I think I am not understanding the logic, but what I want to do is make an if then statement. I want to create a file and then create another file. The code creates the first file, but does not create the second file. What am I doing wrong?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is an easy fix. The problem is you used "elif" when you need to use "if". The elif statement means "else if", meaning execute this if the previous "if" (or "elif") statement is not true. If you only wanted to create ONE of these two files, the use of the elif statement would work. But if you just want to this to work&lt;/SPAN&gt;&lt;STRONG&gt; if&lt;/STRONG&gt;&lt;SPAN&gt; those variables exist, you want to use just if.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def main():
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy, sys, traceback, os, string, locale,arcgisscripting
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.overwriteOutput = True
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from arcpy import env
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; env.workspace =r"C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar"

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outputVGIboundingbox= "VGIboundingbox.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outputGNISboundingbox="GNISboundingbox.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VGIFile = r"C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar\polygon.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GNIS_FC = r"C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar\GNIS.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(outputVGIboundingbox):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(outputVGIboundingbox)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VGIboundingbox= arcpy.FeatureEnvelopeToPolygon_management(VGIFile,outputVGIboundingbox,"MULTIPART")

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt; if&lt;/SPAN&gt; arcpy.Exists(outputGNISboundingbox):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(outputGNISboundingbox)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GNISboundingbox= arcpy.FeatureEnvelopeToPolygon_management(GNIS_Geom,outputGNISboundingbox,"MULTIPART")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a simpler example to illustrate the proper use of if and elif.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;gt;&amp;gt;&amp;gt; # True/False statement
&amp;gt;&amp;gt;&amp;gt; def GreaterThan(x,y):
 if x &amp;gt; y:
&amp;nbsp; print '%s is greater than %s' %(x,y)
 elif x == y:
&amp;nbsp; print '%s is equal to %s' %(x,y)
 else:
&amp;nbsp; print '%s is less than %s' %(x,y)

&amp;nbsp; 
&amp;gt;&amp;gt;&amp;gt; GreaterThan(5,7)
5 is less than 7
&amp;gt;&amp;gt;&amp;gt; GreaterThan(3,3)
3 is equal to 3
&amp;gt;&amp;gt;&amp;gt; GreaterThan(8,2)
8 is greater than 2
&amp;gt;&amp;gt;&amp;gt; &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the above example, I used all three: if, elif, and else. The else statement could have easily been another "elif" statement but then I would have had to put "elif x &amp;lt; y:". I used an else statement instead since there were no possibilities other than less than since greater than and equal to were already used.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:20:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/if-then-statement-for-python/m-p/616197#M2044</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T02:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: If then statement for python</title>
      <link>https://community.esri.com/t5/transportation-questions/if-then-statement-for-python/m-p/616198#M2045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: luke.kaim&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought I only needed another if statement, but when I had two if statements I got the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing: FeatureEnvelopeToPolygon "C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar\polygon.shp" "C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar\VGIboundingbox.shp" MULTIPART&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Tue Jan 22 21:41:11 2013&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Succeeded at Tue Jan 22 21:41:12 2013 (Elapsed Time: 1.00 seconds)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar\boundingbox.py", line 27, in main&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GNISboundingbox_Rows = arcpy.SearchCursor(outputGNISboundingbox)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;class 'Queue.Empty'&amp;gt;:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 00:42:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/if-then-statement-for-python/m-p/616198#M2045</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-01-23T00:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: If then statement for python</title>
      <link>https://community.esri.com/t5/transportation-questions/if-then-statement-for-python/m-p/616199#M2046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I thought I only needed another if statement, but when I had two if statements I got the following error:&lt;BR /&gt;&lt;BR /&gt;Executing: FeatureEnvelopeToPolygon "C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar\polygon.shp" "C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar\VGIboundingbox.shp" MULTIPART&lt;BR /&gt;Start Time: Tue Jan 22 21:41:11 2013&lt;BR /&gt;Succeeded at Tue Jan 22 21:41:12 2013 (Elapsed Time: 1.00 seconds)&lt;BR /&gt;&amp;nbsp; File "C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar\boundingbox.py", line 27, in main&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GNISboundingbox_Rows = arcpy.SearchCursor(outputGNISboundingbox)&lt;BR /&gt;&lt;BR /&gt;&amp;lt;class 'Queue.Empty'&amp;gt;:&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ah, I'm sorry. I thought you meant you did not understand the logic of the if and elif statements.&amp;nbsp; This does show that the second if statement is executing, there is just an error in it.&amp;nbsp; Is this the full code?&amp;nbsp; It is showing an error trying to open a Search Cursor for the outputGNISboundingbox variable.&amp;nbsp; I am not seeing this anywhere in your code though.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since you are deleting this variable, I am guessing that wherever the part of your code where you are using a Search Cursor on this table you are getting an exception because there are no rows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also you may want to change the indentation for the create feature envelopes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(outputVGIboundingbox):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(outputVGIboundingbox)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VGIboundingbox= arcpy.FeatureEnvelopeToPolygon_management(VGIFile,outputVGIboundingbox,"MULTIPART")

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(outputGNISboundingbox):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(outputGNISboundingbox)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GNISboundingbox= arcpy.FeatureEnvelopeToPolygon_management(GNIS_Geom,outputGNISboundingbox,"MULTIPART")
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:20:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/if-then-statement-for-python/m-p/616199#M2046</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T02:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: If then statement for python</title>
      <link>https://community.esri.com/t5/transportation-questions/if-then-statement-for-python/m-p/616200#M2047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: luke.kaim&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The variables are set to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outputVGIboundingbox= "VGIboundingbox.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outputGNISboundingbox="GNISboundingbox.shp" &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is line 10 of the code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This variable is being used just to store the output location of the file. Wouldn't the arcpy.FeatureEnvelopeToPolygon_management need to be indented within the if statement?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 01:11:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/if-then-statement-for-python/m-p/616200#M2047</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-01-23T01:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: If then statement for python</title>
      <link>https://community.esri.com/t5/transportation-questions/if-then-statement-for-python/m-p/616201#M2048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Wouldn't the arcpy.FeatureEnvelopeToPolygon_management need to be indented within the if statement?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not necessarily.&amp;nbsp; For example, if this variable you are wanting to overwrite does not exist, a new variable will not be created to replace it since the if block will only execute if that variable exists in the first place.&amp;nbsp; Are you using the if statement to test if the output variable exists, and if it does you want to delete it?&amp;nbsp; If you take the new variable (the result of the create envelopes tool) out of the if block, a variable will be created every time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 01:18:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/if-then-statement-for-python/m-p/616201#M2048</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-01-23T01:18:23Z</dc:date>
    </item>
  </channel>
</rss>

