AnsweredAssumed Answered

Call feature classes in for loop?

Question asked by gisrsbryce on Jan 6, 2011
Latest reply on Jan 6, 2011 by gisrsbryce
I need something really simple, just need a script that will list all feature classes and the feature count.  Here is what I currently have.  The problem is where "roads" is being called.  I don't know how to call the individual feature classes generated by gp.ListFeatureClasses

Thanks

# Using a 9.3-version geoprocessor
#
import arcgisscripting
gp = arcgisscripting.create(9.3)

gp.workspace = "C:/b/data/test1/mdb/ws_test.mdb/WS"
fcs = gp.ListFeatureClasses()


for fc in fcs:
    
    result = gp.GetCount_management("roads")
    count = int(result.GetOutput(0))
    print fc, count
    



My output looks like this in the intereactive window, which is fine...

GS01_AbsT 4
GS01_ThuL 4
WS01_CerD 4
WS01_AbsT 4
roads 4

Except I need the count # to be associated with the feature class, not one layer named roads.

Outcomes