Dynamically load tool/buttons on Addin toolbar

4058
2
Jump to solution
01-22-2015 01:58 PM
davidrenz
New Contributor III

I have seen some questions pertaining to this here and there, but I have yet to figure out if it is possible.

This is what I want:

I have a suite of ArcObjects (COM) tools that I am beginning to convert to Addins.

However, I don't want to have all of the tools (there are a lot) in the same project or solution even.

I want to be able to independently manage each project as an addin, then move the addin to my Addins directory.

Then, I would like to create a toolbar which can load them all onto the toolbar.

So, each tool would really be an independent tool/command within some ArcMap category, and I am merely organizing them onto a toolbar at some point in the ArcMap load process.

I have seen the documentation on the AddIn.FromID<T> stuff, but I am not clear on how to create a tool/command in code on a toolbar which will invoke the tool/command.

The benefits of Addins is what we are looking for --> the maintainability.

Can someone tell if this is possible and if so, point me in the right direction.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
davidrenz
New Contributor III

It seems maybe I have the wrong idea about this.

Its probably easiest just to write them all as addins, then create toolbars in ArcMap for the tools folks want / need.

Thanks anyways.

View solution in original post

0 Kudos
2 Replies
davidrenz
New Contributor III

It seems maybe I have the wrong idea about this.

Its probably easiest just to write them all as addins, then create toolbars in ArcMap for the tools folks want / need.

Thanks anyways.

0 Kudos
FreddieGibson
Occasional Contributor III

You can do this workflow either way. You can either manually create these toolbars in ArcMap and share the map document as a template with your users or you can create a toolbar within any of your addins use the id of the addin as the references within the XAML that creates the toolbar. If you use the XAML approach you will need to ensure that all of the addins are installed prior to installing the one that references all of the id's for the various commands. Otherwise you could do this dynamically in the code by searching for each item and adding it to a single toolbar at runtime.

0 Kudos