How to change display units

193
6
10-11-2018 12:36 AM
Highlighted
New Contributor II

Hello,

With the sdk, I don't find the way to change, display units when I add a new map to a project.

I can change the name, spatialreference, reference scale ....

        private async void onProjectItemsChanged(ProjectItemsChangedEventArgs obj)

        {
            //if (obj.ProjectItem.GetType()== MapProjectItem)
            if (obj.Action == NotifyCollectionChangedAction.Add)
            {
                if (obj.ProjectItem.GetType().Equals(typeof(MapProjectItem)))
                {
                    MapProjectItem map = (MapProjectItem)obj.ProjectItem;
                    Map mp = map.GetMap();
                    await QueuedTask.Run(() =>
                    {
                        mp.SetName("test");
                        mp.SetSpatialReference(SpatialReferenceBuilder.CreateSpatialReference(3950));
                        mp.SetLabelEngine(LabelEngine.Maplex);
                        mp.SetBasemapLayers(Basemap.None);

                        CIMMap m = mp.GetDefinition();
                       // m.ScaleDisplayFormat
                      
                        m.ReferenceScale = 1000;
                        m.DefaultRotation = 10;
                        m.Description = "Test description";
                        mp.SetDefinition(m);

                    });

            }
            }   
        }

but no way for display units.

Could some help me ?

Thanks 

Reply
0 Kudos
6 Replies
Highlighted
MVP Esteemed Contributor

ArcGIS Pro 2.2 API Reference Guide 

vb Public Property DisplayUnits As Unit

c# public Unit DisplayUnits {get; set;}

Reply
0 Kudos
Highlighted
New Contributor II

Ok, but from wich object, method, is it possible to access to the CIMDimensionStyle ?

Map ?

CIMMap ?

or other ?

Reply
0 Kudos
Highlighted
New Contributor II

Can you give us a sample code of using the property DisplayUnits with a map in the SDK for ArcGis Pro ?

I don't find the way to access to this property from a map !

Reply
0 Kudos
Highlighted
New Contributor II

I just want to change the Display Units from "Decimal Degress" to "Meters" via SDK when a new map is added or loaded.

Thanks in advance for your reply.

Reply
0 Kudos
Highlighted
Esri Regular Contributor

Hi

This is currently not supported in the SDK. Support will be added in version 2.6.

Thanks

Uma

Reply
0 Kudos
Highlighted
Esri Regular Contributor

This did not make it in 2.6 release. It has been moved to the 2.7 release.

Thanks

Uma

Reply
0 Kudos