Using ArcMap Addins In a Standalone Application

02-10-2013 02:15 AM
New Contributor
Using ArcObjects, I've developed several Addins for use within the ArcMap for Desktop (Basic) application.  But now I would like to use some of these same Addins in a Standalone application.  How do I do that, or is it even possible?

0 Kudos
4 Replies
Regular Contributor III
I doubt that you can use them directly.

ArcObjects can be accessed in several different contexts including ArcMap, ArcEngine, or ArcGIS Server.  The way that you inject custom business logic into each of contexts is different.

What you can do is split your add-in such that you can use the heart of your business logic regardless of context.  You then develop a small, context specific, layer on top of that which allows you to inject your logic.
0 Kudos
Regular Contributor
What you can do is split your add-in such that you can use the heart of your business logic regardless of context.

I'll second that.

All of your business logic for add-ins should be in your model.

Example, if you write some code for fetching the layer name from the TOC by layer name, that code should not be located in a GUI, or a controller object.  But if you use that code in other projects, consider making a utility class and storing some "common to all kinds of applications" code in it. Other examples would be code for converting screen coordinates to map coordinates, etc.
0 Kudos
MVP Frequent Contributor

Not sure about AddIns being used in other applications but if you wanted to say have Access drive ArcMap or use your custom ArcObjects in Excel you want to be creating a Class Library under the extending ArcObjects when you create a new Visual Studio project. If it were me I would then develop my Code as a COM Class. The compiled DLL can then be added to the application under the reference section in the VBA editor and then all you code will appear.

0 Kudos
Occasional Contributor
ArcGIS Desktop Add-ins can only be used in Desktop products including ArcMap, ArcCatalog, ArcScene, or ArcGloble.  They cannot be used in ArcGIS Engine application.

If you want to create a tool which can be used in a standalone ArcGIS Engine application, you need to go with the COM-based component implementing ICommand or ITool. The following documentation shows how to do it.

When you create a COM-based component, you can choose to create a "Universal Tool" which can be used in Engine app. Please see the following screen shot of my "ArcGIS New Item Wizard Options" dialog.
0 Kudos