English

How To: Count the vertices for line or polygon features in ArcMap

Summary


Warning:
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.

Procedure

  1. Right-click the layer and select Open Attribute Table.
  2. Click Options > Add Field to add a new field to the layer.
  3. Name the field NumPoints and select Long Integer for the type.
  4. Right-click the new field and select Field Calculator.
  5. Check the Advanced box.
  6. Copy the following text into the Pre-logic VBA Script Code text box.

    Code:
    Dim pPointCount As IPointCollection
    Set pPointCount = [SHAPE]

  7. Type the following text into the lower text box.

    Code:
    pPointCount.PointCount

    [O-Image]
  8. Click OK.