<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Run toolbar tool from another command in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/run-toolbar-tool-from-another-command/m-p/739436#M19625</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a tool (written in C#) that does a number of things, but I want it to run a tool from another (third-party) toolbar as part of the process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I call that other tool from within my own? I've seen help suggesting how to do it in VBA (I think), but I'm not sure how to get that to work in C#.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Set pUID = New UID
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Use the GUID to get a hold of ArcMap Zoom Selected command
&amp;nbsp;&amp;nbsp;&amp;nbsp; pUID.Value = "{AB073B49-DE5E-11D1-AA80-00C04FA37860}"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pDoc = pApp.Document
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pCmdBars = pDoc.CommandBars
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pItem = pCmdBars.Find(pUID, False, True)
&amp;nbsp;&amp;nbsp;&amp;nbsp; If pItem Is Nothing Then Set pItem = pCmdBars.Find(pUID, False, False)
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Execute the zoom selected
&amp;nbsp;&amp;nbsp;&amp;nbsp; pItem.Execute&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In my case I don't want to run the Zoom command. The command I want to run should just run, then my tool should continue once the third-party command is finished. Is this possible?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Jul 2010 22:54:58 GMT</pubDate>
    <dc:creator>MikeLouwrens</dc:creator>
    <dc:date>2010-07-13T22:54:58Z</dc:date>
    <item>
      <title>Run toolbar tool from another command</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/run-toolbar-tool-from-another-command/m-p/739436#M19625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a tool (written in C#) that does a number of things, but I want it to run a tool from another (third-party) toolbar as part of the process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I call that other tool from within my own? I've seen help suggesting how to do it in VBA (I think), but I'm not sure how to get that to work in C#.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Set pUID = New UID
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Use the GUID to get a hold of ArcMap Zoom Selected command
&amp;nbsp;&amp;nbsp;&amp;nbsp; pUID.Value = "{AB073B49-DE5E-11D1-AA80-00C04FA37860}"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pDoc = pApp.Document
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pCmdBars = pDoc.CommandBars
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pItem = pCmdBars.Find(pUID, False, True)
&amp;nbsp;&amp;nbsp;&amp;nbsp; If pItem Is Nothing Then Set pItem = pCmdBars.Find(pUID, False, False)
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Execute the zoom selected
&amp;nbsp;&amp;nbsp;&amp;nbsp; pItem.Execute&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In my case I don't want to run the Zoom command. The command I want to run should just run, then my tool should continue once the third-party command is finished. Is this possible?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jul 2010 22:54:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/run-toolbar-tool-from-another-command/m-p/739436#M19625</guid>
      <dc:creator>MikeLouwrens</dc:creator>
      <dc:date>2010-07-13T22:54:58Z</dc:date>
    </item>
  </channel>
</rss>

