<?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: Why is my script running fine with one feature class but does not run correctly with multiple feature classes? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/why-is-my-script-running-fine-with-one-feature/m-p/267092#M20552</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you print fcBoxZones after running arcpy.ListFeatureClasses, does the list appear correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Oct 2016 00:55:40 GMT</pubDate>
    <dc:creator>JonathanQuinn</dc:creator>
    <dc:date>2016-10-26T00:55:40Z</dc:date>
    <item>
      <title>Why is my script running fine with one feature class but does not run correctly with multiple feature classes?</title>
      <link>https://community.esri.com/t5/python-questions/why-is-my-script-running-fine-with-one-feature/m-p/267090#M20550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The purpose of the script is to count the number of single family homes within each "FireBoxMap" feature class. When I specify a single feature class in line 10 the script runs fine. When I change the feature class to "FireBoxMap*" to run through all of the feature classes it does not populate the desired information. I am not sure what I am doing wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2016 21:56:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/why-is-my-script-running-fine-with-one-feature/m-p/267090#M20550</guid>
      <dc:creator>TravisPreston2</dc:creator>
      <dc:date>2016-10-25T21:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my script running fine with one feature class but does not run correctly with multiple feature classes?</title>
      <link>https://community.esri.com/t5/python-questions/why-is-my-script-running-fine-with-one-feature/m-p/267091#M20551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Travis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may want to move lines 22-24 in front of the for statement and wrap&amp;nbsp;lines 26-37 inside the for statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lesi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2016 22:40:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/why-is-my-script-running-fine-with-one-feature/m-p/267091#M20551</guid>
      <dc:creator>LesiMai3</dc:creator>
      <dc:date>2016-10-25T22:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my script running fine with one feature class but does not run correctly with multiple feature classes?</title>
      <link>https://community.esri.com/t5/python-questions/why-is-my-script-running-fine-with-one-feature/m-p/267092#M20552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you print fcBoxZones after running arcpy.ListFeatureClasses, does the list appear correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 00:55:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/why-is-my-script-running-fine-with-one-feature/m-p/267092#M20552</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2016-10-26T00:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my script running fine with one feature class but does not run correctly with multiple feature classes?</title>
      <link>https://community.esri.com/t5/python-questions/why-is-my-script-running-fine-with-one-feature/m-p/267093#M20553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The question is already answered, but I will write a bit more detail to hopefully help you understand:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have a "For" Loop, but inside the loop you only have the lines of code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print fc&lt;BR /&gt;# Add two fields to hold the results&lt;BR /&gt; arcpy.AddField_management (fc, "SFCount", "LONG")&lt;BR /&gt; arcpy.AddField_management (fc, "MFCOUNT", "LONG")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The rest of the code is not indented, so does not get included in the loop!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So your script currently works as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each FC:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print FC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;add fields to FC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the last FC in the loop only:&lt;/P&gt;&lt;P&gt;selection &amp;nbsp;+ calculate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fix, simply indent all code after your "For" loop&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 13:45:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/why-is-my-script-running-fine-with-one-feature/m-p/267093#M20553</guid>
      <dc:creator>LukeWebb</dc:creator>
      <dc:date>2016-10-26T13:45:57Z</dc:date>
    </item>
  </channel>
</rss>

