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
Solved! Go to Solution.
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
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
If you print fcBoxZones after running arcpy.ListFeatureClasses, does the list appear correct?
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