AnsweredAssumed Answered

How to change display units

Question asked by sigu on Oct 11, 2018
Latest reply on Oct 11, 2018 by sigu

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 

Outcomes