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
Great! Thank you very much!
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 <SPAN class="operator token">=</SPAN> FrameworkApplication<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetPlugInWrapper</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"esri_sharing_ExportMap"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> command <SPAN class="operator token">=</SPAN> wrapper <SPAN class="keyword token">as</SPAN> ICommand<SPAN class="punctuation token">;</SPAN> <SPAN class="comment token">// tool and command(Button) supports this</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">(</SPAN>command <SPAN class="operator token">!=</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">&&</SPAN> command<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CanExecute</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> command<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Execute</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Thanks
Uma
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.