Set map units or override units to DMS

274
2
10-07-2011 05:02 AM
AlexanderGray
Occasional Contributor III
Does any one know how to set the display units (or distance units) on the map programmatically to DMS (degree minutes seconds) or how to change the ArcMap options, dataview 'use these units instead of the frame's Display units (Degreee Minutes Seconds)?

The IMap.DistanceUnits are esriUnits and have no DMS.  I have not figured out how to access the ArcMap Options to override the units. 

Thanks
0 Kudos
2 Replies
DuncanHornby
MVP Notable Contributor
Alex,

Below is some VBA code that I think achieves what you are asking. Interestingly it does not seem to adjust the setting in the dataframe > Properties > General > Units(display) drop down.

Duncan

Public Sub test()
    Dim pMXDoc As IMxDocument
    Set pMXDoc = ThisDocument
    
    Dim pLatLonFormat As ILatLonFormat2
    Set pLatLonFormat = New LatLonFormat
    With pLatLonFormat
        .ShowDirections = True
        .ShowZeroMinutes = True
        .ShowZeroSeconds = True
    End With
    
    Dim pReportUnitFormat2 As IReportUnitFormat2
    Set pReportUnitFormat2 = pMXDoc
    pReportUnitFormat2.CoordinateReadoutUnits = esriDecimalDegrees
    Set pReportUnitFormat2.CoordinateReadoutLatLonFormat = pLatLonFormat
End Sub
0 Kudos
AlexanderGray
Occasional Contributor III
Tthanks Duncan, you don't actually have to set the latlon properties, they all kind of just default.  It is a work-around for my problem but the kicker is if you change back the Arcmap property to DD or if you change it to Degree Decimal minutes, the map is still DMS.  If you change it to meters, the map changes to meters.  Any Lat/Lon based system defaults to DMS.

Based on this article, I think this was an pre-ArcGIS 10 thing.
http://support.esri.com/en/knowledgebase/techarticles/detail/20801#comment-8682
Alex
0 Kudos