Get Count (Data Management) |
|
Release 9.3
Last modified March 8, 2012 |
![]() ![]() ![]() Print all topics in : "Tools" |
NOTE: This topic was updated for 9.3.1.
Returns the total number of rows for a feature class, table, or layer
Usage tips
The row count returned by the tool will be displayed in the geoprocessing window.
If the input contains a selected set of records, only the selected records will be counted.
This tool can be used in ModelBuilder to set up a precondition, as illustrated in the graphic below. Get Count is used to check the number of records returned by Select. If the record count is zero, then Buffer will not run.
Learn more about controlling the flow of processing in models.
The environment settings do not affect this tool.
Command line syntax
An overview of the Command Line window
GetCount_management <in_rows>
Parameter | Explanation | Data Type |
<in_rows> |
The input feature class, table, or layer used to determine the number of features for a geoprocessing operation |
Table View | Raster Layer |
GetCount D:\workspace.mdb\roads
Scripting syntax
About getting started with writing geoprocessing scripts
GetCount_management (in_rows)
Parameter | Explanation | Data Type |
in_rows (Required) |
The input feature class, table, or layer used to determine the number of features for a geoprocessing operation |
Table View | Raster Layer |
# Using a 9.3-version geoprocessor # import arcgisscripting gp = arcgisscripting.create(9.3) gp.workspace = "D:/Workspace" result = gp.GetCount_management("roads") count = int(result.GetOutput(0))
# Using a 9.2-version geoprocessor # import arcgisscripting gp = arcgisscripting.create() gp.workspace = "D:/Workspace" count = gp.GetCount_management("roads")