I am using arcgis 10.1 I am currently doing a lot of sql query feature class and I am thinking of automating this process

so far my escrip is as follows

import arcpy
arcpy.SelectLayerByAttribute_management("casa","NEW_SELECTION"," [color] = 'blanco' ")

then I get a count of the selected

contador = int(arcpy.GetCount_management("casa").getOutput(0))
print contador


then do another query on the same feature class and I get him the count and repeat this process as many times

on the same feature class conducted many consultations

my first question is how could I modify this scrip to use and able to put in modelbuider as input parameter one feature class and make all of these query as defined in escrip

my second question if I could list all the results it gives me the count of each query and export them to a table


Rather than using a method like that you describe in your Question, I recommend that you investigate the Summary Statistics (Analysis) tool which has COUNT as one of its available statistic types.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.