Select to view content in your preferred language

How to track event when datum transformation changes

10-04-2018 02:19 AM
New Contributor II

Is there a event in ArcGIS Pro SDK for .NET (C#) which occurs whenever a datum transformation is changed?#

0 Kudos
1 Reply
Esri Regular Contributor


You can use the MapPropertyChangedEvent.  When you change the datum transformation on a map, this event is fired. You can subscribe to this event in your module class. Below is a code snippet that subscribes to the event, and an event handler that is called when it triggers. In the event handler, we check the Map Definition's DatumTransforms or HVDatumTransforms property to get the changed value.  

Note: Store the current (previous) values for the Datum also in the module class to compare with the changed value you get from the event handler.



protected override bool Initialize(){
      return base.Initialize();

private void OnMapPropertyChanged(MapPropertyChangedEventArgs obj){
       if (obj.EventHints.Any())
            if (MapView.Active.Map is null)
             var cimMapDefinition = MapView.Active.Map.GetDefinition();

             var datumTransformations = cimMapDefinition.DatumTransforms; // use if map's sr does not have a vertical coordinate system
             var hvDatumTransformations = cimMapDefinition.HVDatumTransforms;    // use if map's sr has a vertical coordinate system

0 Kudos