Set Data Frame Display Units

2583
2
Jump to solution
01-21-2014 09:41 AM
DaveCouture
New Contributor III
Using VB.NET, I created a function that will always start ArcMap with a certain Projected Coordinate System. By default, the Map Units and Display Units (Data Frame) are set to Meters, when using this Spatial Reference. How can I change the Display Units?  I know how to change the Map Units to Kilometers (10), but how can I modify the code to change the Display Units?


 Dim dataView As IActiveView = My.ArcMap.Document.ActiveView  dataView.ScreenDisplay.DisplayTransformation.Units = 10  dataView.Refresh()
0 Kudos
1 Solution

Accepted Solutions
DuncanHornby
MVP Notable Contributor
The code you need is:

' Get a handle on DataFrame Dim pMap as IMap pMap = My.ArcMap.Document.FocusMap  ' Set Display Units to meters pMap.DistanceUnits = esriMeters  ' Set Map units pMap.MapUnits = esriMeters

View solution in original post

0 Kudos
2 Replies
DuncanHornby
MVP Notable Contributor
The code you need is:

' Get a handle on DataFrame Dim pMap as IMap pMap = My.ArcMap.Document.FocusMap  ' Set Display Units to meters pMap.DistanceUnits = esriMeters  ' Set Map units pMap.MapUnits = esriMeters
0 Kudos
DaveCouture
New Contributor III
Thanks again!  It's funny that you can use the IDisplayTransformation Interface to change the Map Units, but you can't use it to change the Display Units. There are no members for it.  Also, I might be missing a Reference, because I get an error on the esriMeters Constant. That's why I use the Constant Value, instead.

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//004200000030000000
0 Kudos