ArcGIS Pro 2.6 API Reference Guide
Clone Method (Geometry)

ArcGIS.Core.Geometry Namespace > Geometry Class : Clone Method
Clones this geometry instance. As geometry objects are immutable and hence never change, the clone returned will be this object rather than a copy of this instance.
public Geometry Clone()
Public Function Clone() As Geometry

Return Value

A geometry

For Internal Use Only:
In some geodatabase operations it may make sense for a geometry to be set to be recycling for performance or internal resource allocation reasons. In this scenario the geometry's content may change via some external code (i.e. GDB NextFeature). Consequently, the Clone method will return a new geometry with the copied contents of this instance rather than the original object. This cloned geometry should be passed to the code requiring the geometry object.

// Use a builder convenience method or use a builder constructor.

// Builder convenience methods don't need to run on the MCT.
// create a 3d point with M
MapPoint pt = MapPointBuilder.CreateMapPoint(1.0, 2.0, 3.0, 4.0);

MapPoint ptWithM = null;

// Builder constructors need to run on the MCT.
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
  using (MapPointBuilder mb = new MapPointBuilder(1.0, 2.0, 3.0, 4.0))
    // do something with the builder

    ptWithM = mb.ToGeometry();

MapPoint clone = ptWithM.Clone() as MapPoint;
MapPoint anotherM = MapPointBuilder.CreateMapPoint(ptWithM);

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also


Geometry Class
Geometry Members