| GIS@Grinnell
: Training
Calculate Length of Line Feature
- Open the attribute table of the layer you want to add
length to.
- Right-click the field heading for length (if there is
no field holding length values you can add a new field for
length by clicking the options button and selecting the
new field option).
- Click Calculate Values.
- Check Advanced.
- Type or paste the following VBA statement in the first
text box:
- Dim dblLength as double
- Dim pCurve as ICurve
- Set pCurve = [shape]
- dblLength = pCurve.Length
- Type or paste the variable dblLength in the text box directly
under the length field name.
- Click OK.
- Tip: The property length returns a field type of double.
For best results, your length field should also be a double
field type.
|