HOW TO
When you change from one projected coordinate system to another, the display units automatically change to match the map units. However, when you change from a projected coordinate system to a geographic coordinate system, the display units remain in their previous linear units. The following sample script synchronizes the map units and display units whenever you change the data frame's coordinate system.
Code:
Private WithEvents MapActiveViewEvents As Map
Private Function MxDocument_NewDocument() As Boolean
EventListener
End Function
Private Function MxDocument_OpenDocument() As Boolean
EventListener
End Function
Private Sub EventListener()
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
Set MapActiveViewEvents = pMxDoc.FocusMap
End Sub
Private Sub MapActiveViewEvents_SpatialReferenceChanged()
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
Dim pMap As IMap
Set pMap = pMxDoc.FocusMap
'-- Set display units to be the same as map units
pMap.DistanceUnits = pMap.MapUnits
End Sub
Note:
The above code has been associated with the normal template and responds to the SpatialReferenceChanged event. It will be initialized the next time you start a new ArcMap document or load a pre-existing document.
Article ID:000004333
Get help from ArcGIS experts
Download the Esri Support App