Show / Hide Table of Contents

Method ReplaceGeometry

ReplaceGeometry(Geometry)

Replaces the current Geometry with the specified geometry.

Declaration
public void ReplaceGeometry(Geometry geometry)
Parameters
Type Name Description
Geometry geometry

The new geometry to replace the current geometry. The GeometryType of these geometries must match.

Remarks

Use this method to make changes to the Geometry that are not directly supported using other GeometryEditor methods. For example, to start a new part in a Polygon or Polyline geometry, get the current Geometry, use a MultipartBuilder<T> to add the required part, and then pass the updated ToGeometry() to this method.

The Geometry is replaced by the given geometry, and therefore the z-awareness of Geometry will be the same as the given geometry.

Exceptions
Type Condition
InvalidOperationException

The GeometryEditor must be started in order to replace its geometry.

ArgumentException

The replacement GeometryType must match the existing Geometry type.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0200.3 - 200.8
.NET200.3 - 300.0
.NET Windows200.3 - 300.0
.NET Android200.3 - 300.0
.NET iOS200.3 - 300.0
.NET Framework200.3 - 200.8
UWP200.3 - 200.8
In this article
Provide feedback
Back to top Copyright © 2025 Esri.