How can an Add-In interact with another Add-In?

01-06-2014 10:44 PM
New Contributor III
Hi all!

Last year I developed an Add-In which works together with an Extension. In the Add-In code i get the extension with these rows:
Dim extensionID As New UIDClass()
extensionID.Value = "Id_of_Extension"
Dim pExtension As IExtension = pApplication.FindExtensionByCLSID(extensionID)

After these rows the Add-In calls methos from the Extension and this works fine.
But now we are converting the extension to an Add-In and I need a similar solution to get the Add-In. I don't find code examples on the ESRI sites. Maybe I use the wrong search words 😉
Is there a similar method to get an Add-In for working with it?

0 Kudos
2 Replies
New Contributor
Hi, Jörg

I use the follow C# code to get other addin buttons in my toolbar:

using ESRI.ArcGIS.Desktop.AddIns;

// Enable the save button
SaveEditingButton saveButton = ddIn.FromID<SaveEditingButton>(ThisAddIn.IDs.RasterEditor_EditorMenu_Edition_SaveEditingButton);
saveButton.IsEnabled = true;

IDs of addins are deifned at the Config.esriaddinx file of your solution folder. I am not sure whether it works for extension too but I think it should be similar. I hope it helps.

0 Kudos
New Contributor III
hi Haoliang

thanks for your answer. I will try it soon and I am optimistic that these code will help me 🙂

0 Kudos