I am developing a tool to assist GIS Techs in the process of georeferencing thousands of scanned maps.
I need to:
1) add the .tiff to the map with a button click (done)
2) open the georeferencing toolbar automatically
The code below doesnt seem to do anything. I cannot get any tab /ribbon to activate with this code. Is there a different way of achieving this?
3) execute the command "esri_mapping_georeferenceing_StartSessionButton"
The code below does not seem to run. CanExecute is returning False. But, when I try different commands such as esri_mapping_georeference_MoveButton, Command.Execute doesn't do anything.
var commandId = @"esri_mapping_georeferenceing_StartSessionButton";
// get the ICommand interface from the ArcGIS Pro Button
// using command's plug-in wrapper
var iCommand = FrameworkApplication.GetPlugInWrapper(commandId) as ICommand;
if (iCommand != null)
// Let ArcGIS Pro do the work for us
if (iCommand.CanExecute(null)) iCommand.Execute(null);
How do I programatically execute built in commands in the georeferencing area? I read a different post that says sometimes you may have to activate a parent item before the child is accessible. If that is true, how do I determine what the parents are?
4) After the user does the georeferencing, I want to read the data from the georeferencing tool window (such as rotation, origin coordinates, scale). Is this possible to hook into the built in tools to control them / read their data?
Thank you very much for any assistance. I am trying lots of things and reading all I can find but I am missing something as I can't get anything to run. New to Pro, familiar with ArcObjects and WPF.
Relevant daml ids:
Name: Selected map has an active georeferencing edit session.
Name: Close Georeference
Name: Elevate To Ground
Name: Move To Display
Name: Save As New
Name: Save To Workspace
I made a discovery on item 3 regarding the inability to execute existing tools on the ribbons.
With the DAML ids, using the DAML id generator and the SDK documentation, I had ids:
These do nothing when called.
when I use the 3rd option for DAML ids,
Have you tried selecting your tiff layer on the TOC (contents pane) before trying to activate the Georeference tab?
You can activate a layer in the TOC programmatically using the SelectLayer method on the MapView.
Here is the API Reference topic on this method. There is a code snippet in this topic: SelectLayers
Pro is contextual, so the Georeference tab will only be displayed if the selected layer in the TOC is a raster layer.
Regarding DAML Ids for buttons and tools, I find that using the "Show command IDs on Screen Tips" option is the most convenient way.
Thank you Uma for the reply. It turn out that the georeferencing tab was getting activated, but there was a setting that we had to change to make it appear: