ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Geometry Namespace / AreaUnit Class / ConvertTo(Double,AreaUnit) Method
Area in the units of this instance.
Unit to convert to.
Example

In This Topic
    ConvertTo(Double,AreaUnit) Method
    In This Topic
    Converts the area to the provided area unit.
    Syntax
    Public Function ConvertTo( _
       ByVal inArea As Double, _
       ByVal outUnit As AreaUnit _
    ) As Double
    public double ConvertTo( 
       double inArea,
       AreaUnit outUnit
    )

    Parameters

    inArea
    Area in the units of this instance.
    outUnit
    Unit to convert to.

    Return Value

    Area converted to the specifed unit.
    Exceptions
    ExceptionDescription
    The outUnit is null.
    Example
    AreaUnit - Convert between hectares and acres
    {
      // convert 2 hectares to acres
      double acres = AreaUnit.Hectares.ConvertTo(2, AreaUnit.Acres);
    }
    AreaUnit - Convert between hectares and square miles
    {
      // convert 300 hectares to square miles
      double sqMiles = AreaUnit.Hectares.ConvertTo(300, AreaUnit.SquareMiles);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also