How To: Count the vertices for line or polygon features in ArcMap
The procedure below is for ArcGIS 9.3.1 or earlier versions. Starting at ArcGIS 10.0, expressions in the Calculator are created using only VBScript or a standard Python format. See Count the vertices for line or polygon features in ArcMap 10.
In Workstation ArcInfo, the COUNTVERTICES command can be used to write the number of vertices for a line or polygon feature to the attribute table. Instructions provided describe how to do the same in ArcMap.
- Right-click the layer and select Open Attribute Table.
- Click Options > Add Field to add a new field to the layer.
- Name the field NumPoints and select Long Integer for the type.
- Right-click the new field and select Field Calculator.
- Check the Advanced box.
- Copy the following text into the Pre-logic VBA Script Code text box.
Dim pPointCount As IPointCollection
Set pPointCount = [SHAPE]
- Type the following text into the lower text box.
- Click OK.
Last Published: 5/5/2016
Article ID: 000004889