Refreshing Addins in 10.1

1305
4
Jump to solution
04-23-2012 03:54 AM
KimOllivier
Occasional Contributor III
I cannot see how to fix a simple problem in a custom AddIn using the new Addin Wizard without closing ArcMap and re-opening.
Is this really required for every edit of an addin?

This is what I do when testing.
1. Install the addin and open in ArcMap, open the python window.
2. Test the tool when inevitably there is a runtime error.
3. Edit the python script and tabnanny.
4. Re run makeaddin.py
5. Reinstall by clicking on ,tool>esriaddin

But if ArcMap was still open it does not refresh the addin.
I have tried using the AddInmanager to delete before and after etc
Note that the tool does not disappear from the Customise Toolbars list
The only way is to close ArcMap and reopen which takes a lot of time.

I have found the updating of the versioning a real pain as well, with it overwriting the existing script, but that is a known feature.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
ChrisFox3
Occasional Contributor III
Hi Kim,

To make a change to your python script you should close out of the application, rebuild and install the add-in and restart the application. Behind the scenes what happens when you start the application is the addin is copied and unpacked to the local assembly cache, which is where the code is executed from. Everytime the application starts up it checks the addin folder and if the addin is different from the one in the local assembly cache the application will overwrite the old version.

This is the same behavior for .Net and Java addins as well, if you need to modify the code you will have to rebuild the add-in, install and restart the application.

View solution in original post

0 Kudos
4 Replies
ChristinaGnadinger
New Contributor II
Are you editing the version of the script that is part of the 'installed' bundle? If so then you shouldn't have to close and reopen ArcMap.

If you're making changes to the code only you should be able to change the installed script and re-run it. You shouldn't have to re-build the add-in. If you're affecting the add-in components then you'll need to make changes and recreate the add-in.

This link should help:
http://resourcesbeta.arcgis.com/en/help/main/10.1/index.html#/Editing_add_ins/014p0000001v000000/
0 Kudos
KimOllivier
Occasional Contributor III
There is only one text source for a Python script, but after an edit it is compressed into a zip bundle *.esriaddin using makeaddin.py
I am then supposed to double click on it to install it into the well known location in MyDocuments.

I assume this  is different to addins created in java and .NET where the source is in an IDE. The Python wizard is not an integrated environment. So if you are creating a .NET addin you can edit your (non-python) script while ArcMap stays up?

It all works just fine if I close and reopen ArcMap, but what a pain!
It seems that the addin is loaded into memory when ArcMap starts and no amount of deleting refreshes the image of the addin.
0 Kudos
ChrisFox3
Occasional Contributor III
Hi Kim,

To make a change to your python script you should close out of the application, rebuild and install the add-in and restart the application. Behind the scenes what happens when you start the application is the addin is copied and unpacked to the local assembly cache, which is where the code is executed from. Everytime the application starts up it checks the addin folder and if the addin is different from the one in the local assembly cache the application will overwrite the old version.

This is the same behavior for .Net and Java addins as well, if you need to modify the code you will have to rebuild the add-in, install and restart the application.
0 Kudos
KimOllivier
Occasional Contributor III
That is a bit clumsy, given the time to open ArcMap. Oh well, now I know.

I was hoping for a menu dropdown that could refresh the AddIn cache without exiting ArcMap.
Like Python does it for modules with reload(module)