1

I have a Python add-in with a good amount of buttons and menus. I'm trying to remove a menu using the addin_assistant, but the menu isn't being removed from config.xml. I've tried removing the add-in in ArcMap and re-adding it, but that didn't help.

The process I'm doing:

  1. Open the Python Add-in Wizard, browse to my add-in folder.
  2. Find the menu. Right click and Remove.
  3. Save. Click OK for the backup warning message.
  4. The config.xml document date is modified automatically by saving.
  5. Open the XML and see that the menu is not removed.

Quick thoughts: I've tried restarting my computer. I've removed buttons successfully. I can't remake the add-in every time I want to remove a menu. Customize Mode -> Delete for the menu (in ArcMap) isn't feasible because this add-in will be shared with hundreds of users.

Any thoughts? Please let me know if you need more info.

Edit:

I've copied the contents of my add in folder to a different folder. I tried removing the menu the way I previously described and it didn't work.

I edited the XML in Notepad++ to manually remove the menu and ran the makeaddin.py file, then removed and re-added the add-in in ArcMap. This didn't remove the menu.

Double clicking and installing the esri addin file worked to remove the menu since I've edited the XML, but now when I try to access the add-in directory using the add-in assistant I get an error window that says:

Error initializing Add-In

add-in name.menu_remove (which was the name of the menu ID).

It seems that the addin_assistant is expecting to find menu, but since it was removed in XML it's throwing an error.

Edit 2

I didn't fully delete all of the required lines in XML. The error thrown above no longer appears. I had to delete both the Menu caption for the menu category and the Menu refID that referenced my menus ID (menu_remove).

Editing the XML works well enough to consider this answered. Esri believes the issue is a bug or limitation with the python addin wizard. I'll add that info when I receive it.

1

This is a two-part question, but here we go:

  1. If you are absolutely certain you are doing the process you claim to the letter and the menu item is still not being deleted from the configuration XML, you may need to go into the .XML file and delete the menu by hand in a text editor like Notepad++. You may want to file an issue with Esri support, there may be a bug in the Python add-in wizard. I tried adding/removing menus with various item types and I had no problem, so you may need to share the add-in with Esri.
  2. There is a documented way to deploy add-ins via a shared network folder so every time you update the .esriaddin file usrs that are configured to use the add-in will see your updates.
  • I'm certain that I'm doing the process correctly. I'm hesitant to edit the .xml, but if ESRI support can't find anything I will do that. Also, I will be using that deployment method you linked. Distributed was a bad word choice. – olivad80 Oct 1 '14 at 12:46
  • Worst case scenario: the Add-In Wizard source is available online. It's a simple wxPython application, should be fairly easily hackable. – Jason Scheirer Oct 1 '14 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.