Create a reload function for Python Addin modules

07-06-2016 09:03 AM
Status: Open
Labels (2)
Regular Contributor

Python Addins have a terrible, awful, no good debugging process.

Code > Build > Initialize Client App > Install > Test > Repeat.

Honestly, it wouldn't be so bad if ArcMap didn't take so long to initialize that I could grow a beard while waiting for it to get a license and load a blank document. Python Addins need a process to reload the addin module, and by reload I mean completely, including the config.xml and image files from the assembly cache.

If this were possible, we could change the debugging process to:

Code > Build > Reload > Test

Why would we not want to do that? Additionally, if we could manipulate the config.xml and reload, that would bring new functionality to the table, including the ability to create semi-dynamic GUIs that could change based on a set of conditions, such as changing the image asset used for a button based on a specific condition.

1 Comment

John Dye , fwiw, I find the fastest way to refresh addins when developing (i.e. after a .updating a .py) without having to close/open Catalog/Map is to

  1. run (double-click) make
  2. Right-click in gray area or use the Customize-CustomizeMode
  3. Highlight your addin (although this might not be necessary)
  4. "Add from File" and select <your addin>.esriaddin file. 

That loads the update addin without having to close the ArcGIS Desktop session which saves a lot of time.  And it at least remembers this path if you are editing the same addin over and over.  So not a wonderful solution, but as often as I "repeat" when working on addins, saving 15-60+ seconds each time reduces my frustration.

If there was a way to create a button that enters the Customize Mode and loads from a file, that would make this process work, but I don't know if that is possible.