HOW TO

Modify vertex z-values of multiple line features using Arcade in ArcGIS Pro

Last Published: March 13, 2025

Summary

In ArcGIS Pro, vertex z-values of line features can be modified using either the Edit Vertices tool or the Calculate Field tool to ensure consistent z-values, enabling accurate spatial analysis and visualization. While the Edit Vertices tool allows applying the same z-value to multiple vertices, it only supports editing vertices of one line feature at a time.

However, the process can be simplified using Arcade in the Calculate Field tool and this article provides the workflow. In this example, the vertex z-values of multiple line features are modified to ‘0’ using an Arcade expression in ArcGIS Pro.

Procedure

Note:
The Calculate Field tool modifies the input data. Refer to ArcGIS Pro: Tools that modify or update the input data for more information. To enable undo, toggle Enable Undo on in the Calculate Field window before running the tool.
  1. Open the ArcGIS Pro project.
  2. On the Contents pane, right-click the line feature layer and click Attribute Table.
  3. Configure the Shape field using the Calculate Field tool.
    1. In the attribute table, right-click the Shape field header and click Calculate Field.
    2. In the Calculate Field window, for Expression Type, select Arcade.
    3. Under Expression, specify the Arcade expression in the expression box using the one provided below. Replace <value> with the new value of the vertex z-values.
var paths = Geometry($feature).paths
var new_paths = []
for(var p in paths) {
    var path = paths[p]
    var new_path = []
    for(var v in path) {
        var vertex = path[v]
        var new_vertex = [vertex.x, vertex.y, <value>]
        Push(new_path, new_vertex)
    }
    Push(new_paths, new_path)
}
return Polyline({paths: new_paths, spatialReference: Geometry($feature).spatialReference})
  1. Click Verify to validate the expression.
  2. Click OK.
The Calculate Field window

The ArcGIS Pro attribute table shows line features with vertex z-values, '0'.

Line features with vertex z-values 0

Article ID: 000034969

Software:
  • ArcGIS Pro 3 3
  • ArcGIS Pro 3 2
  • ArcGIS Pro 3 4

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options