Select to view content in your preferred language

Run toolbar tool from another command

402
0
07-13-2010 03:54 PM
MikeLouwrens
Frequent Contributor
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.

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#.

Set pUID = New UID
    ' Use the GUID to get a hold of ArcMap Zoom Selected command
    pUID.Value = "{AB073B49-DE5E-11D1-AA80-00C04FA37860}"
    Set pDoc = pApp.Document
    Set pCmdBars = pDoc.CommandBars
 
    Set pItem = pCmdBars.Find(pUID, False, True)
    If pItem Is Nothing Then Set pItem = pCmdBars.Find(pUID, False, False)
 
    'Execute the zoom selected
    pItem.Execute


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?

Thanks,
Mike.
0 Kudos
0 Replies