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.
Thank You
Travis,
You may want to move lines 22-24 in front of the for statement and wrap lines 26-37 inside the for statement.
Lesi
The question is already answered, but I will write a bit more detail to hopefully help you understand:
You have a "For" Loop, but inside the loop you only have the lines of code:
print fc# Add two fields to hold the results arcpy.AddField_management (fc, "SFCount", "LONG") arcpy.AddField_management (fc, "MFCOUNT", "LONG")
The rest of the code is not indented, so does not get included in the loop!
So your script currently works as follows:
For each FC:
print FC
add fields to FC
On the last FC in the loop only:
selection + calculate
To fix, simply indent all code after your "For" loop
If you print fcBoxZones after running arcpy.ListFeatureClasses, does the list appear correct?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.