Select to view content in your preferred language

Display Statistics for Selected Features

766
1
01-19-2011 02:53 PM
SeanCook
Emerging Contributor
Hello all,

I am trying to write a code that will display statistics for selected features...i.e. I select a group of polygons, click a button which executes a python tool, and a table pops up displaying mean, max, min and a frequency distribution graph. I don't want this to create a table....I would like it to do the same thing as opening up the selection statistic dialog box which can be accessed from the attribute table.

What would be the best way of going about this? I have seen a VBA code do this before.

My first guess was to use a cursor to iterate over the rows, grab the values and do the stats myself, but I can see no way to get the cursor to respect selections.

My second attempt was to use the Summary Statistics tool, but I don't want an output table which has to be viewed, I want something to pop up with my values automatically, either through arcgis or a python extension.

Any help would be much appreciated on both getting the values, and displaying them. I am pretty comfortable with python, so I just need some pointers on how to get started, and can probably figure it out from there.

TIA,

Sean
0 Kudos
1 Reply
DuncanHornby
MVP Notable Contributor
Sean,

Why don't you use the summary statistics table but the output goes to an In_Memory table. You collate your information from the table display as you wish and then delete the In_Memory workspace and if you set the environment of the geoprocessor to not add to display they should never see it.

Duncan
0 Kudos