How do you programatically access the Export and Print buttons on the Sharing tab?

54
2
07-02-2018 06:55 AM
Highlighted
New Contributor

Is there any way to execute the Print or Export buttons on the Sharing ribbon? I'm trying to write a simple tool that automates the creation of a layout and I'd like to be able to trigger the stock tools from a button on my dockpane.

Thanks,

Scott Dickison

LOJIC

Reply
0 Kudos
2 Replies
Highlighted
Esri Regular Contributor

Here is a sample that shows you how you can use ArcGIS Pro commands in your own add-ins: HookProCommands

In your case, here are the snippets to execute Pro's Export button. The id to use for the print button is: "esri_sharing_PrintMap"

IPlugInWrapper wrapper = FrameworkApplication.GetPlugInWrapper("esri_sharing_ExportMap");
var command = wrapper as ICommand; // tool and command(Button) supports this
if ((command != null) && command.CanExecute(null))
   command.Execute(null);

Thanks

Uma

Reply
0 Kudos
Highlighted
New Contributor

Great! Thank you very much!

Reply
0 Kudos