This document is archived and information here might be outdated.  Recommended version.


IMap.DistanceUnits Property (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Carto)  

IMap.DistanceUnits Property

The distance units for the map.

[Visual Basic .NET]
Public Property DistanceUnits As esriUnits
[C#]
public esriUnits DistanceUnits {get; set;}
[C++]
HRESULT get_DistanceUnits(
  esriUnits* unitsCode
);
[C++]
HRESULT put_DistanceUnits(
  esriUnits unitsCode
);
[C++]

Parameters unitsCode [out, retval]
unitsCode is a parameter of type esriUnits unitsCode [in]
unitsCode is a parameter of type esriUnits

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

The units - for example, feet, miles, meters, kilometers - ArcMap uses to report measurements, dimensions of shapes, and distance tolerances and offsets.

Remarks

DistanceUnits is the predefined enumeration (esriUnits) data type currently associated with the Map object.
AddLayer automatically attempts to set the Map's SpatialReference property if a coordinate system has not yet been defined for the map.  When the SpatialReference property is set, the Map's MapUnits and DistanceUnits properties  are set as well.
When multiple layers are added simultaneously with AddLayers, the first spatial reference found is used.
If no layers have a spatial reference, AddLayer checks the extent of the first layer (ILayer::AreaOfInterest) and if it has coordinates that look like geographic coordinates (XMin >= -180 and XMax <= 180 and YMin >= -90 and YMax <= 90), ArcMap assumes the data is in decimal degrees and sets the MapUnits to esriDecimalDegrees and DistanceUnits to esriMiles.
If no spatial reference is found and the coordinates do not look like geographic coordinates, ArcMap sets no spatial reference and sets the MapUnits to esriMeters and the DistanceUnits to esriMeters.

See Also

IMap Interface