ArcGIS Pro 2.7 API Reference Guide
ProjectEx Method (GeometryEngine)
Example 

ArcGIS.Core.Geometry Namespace > GeometryEngine Class : ProjectEx Method
The geometry to be projected. The geometry spatial reference is ignored.
The projection transformation to use. The geometry is projected from the projTransformation.InputSpatialReference to the projTransformation.OutputSpatialReference
Projects the given geometry to a new spatial reference.
Syntax

Parameters

geometry
The geometry to be projected. The geometry spatial reference is ignored.
projTransformation
The projection transformation to use. The geometry is projected from the projTransformation.InputSpatialReference to the projTransformation.OutputSpatialReference

Return Value

The projected geometry.
Exceptions
ExceptionDescription
Geometry is null or empty.
The method is not implemented for GeometryBag.
Projection transformation is null.
Example
// methods need to be on the MCT
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
  SpatialReference sr4267 = SpatialReferenceBuilder.CreateSpatialReference(4267);
  SpatialReference sr4326 = SpatialReferences.WGS84;
  SpatialReference sr3857 = SpatialReferences.WebMercator;

  // Create transformation from  4267 -> 3857
  ProjectionTransformation projTransFromSRs = ArcGIS.Core.Geometry.ProjectionTransformation.Create(sr4267, sr3857);

  // create an envelope
  Envelope env = EnvelopeBuilder.CreateEnvelope(new Coordinate2D(2, 2), new Coordinate2D(3, 3), sr4267);

  // Project with one geo transform 4267 -> 3857
  Envelope projectedEnvEx = GeometryEngine.Instance.ProjectEx(env, projTransFromSRs) as Envelope;

  // Create inverse transformation, 3857 -> 4267
  ProjectionTransformation projTransFromSRsInverse = ArcGIS.Core.Geometry.ProjectionTransformation.Create(sr3857, sr4267);
  // Project the projected envelope back using the inverse transformation
  Envelope projectedEnvBack = GeometryEngine.Instance.ProjectEx(projectedEnvEx, projTransFromSRsInverse) as Envelope;

  bool isEqual = env.IsEqual(projectedEnvBack);
});
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

GeometryEngine Class
GeometryEngine Members