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
ArcGIS Pro 2.2 API Reference Guide
vb Public Property DisplayUnits As Unit
c# public Unit DisplayUnits {get; set;}
Ok, but from wich object, method, is it possible to access to the CIMDimensionStyle ?
Map ?
CIMMap ?
or other ?
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 !
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.
Hi
This is currently not supported in the SDK. Support will be added in version 2.6.
Thanks
Uma
This did not make it in 2.6 release. It has been moved to the 2.7 release.
Thanks
Uma
Hi Uma,
Did this change make it to 2.7+?
Also, I have discovered (in 2.8.3) that trying to set the rotation of a map (example from above: m.DefaultRotation = 10;) in a project does not work. Changes to the rotation in ArcGIS Pro will reflect correctly in code, but attempts to set a new value will not appear in Pro.
Thanks,
Bob