Python Add-In Extension doesn't work

4551
5
09-12-2013 09:07 PM
StacyRendall1
Occasional Contributor III
After creating an Add-In with Toolbar, Menu and Extension objects and doing Add From File... in the Customize dialog box only Toolbar and Menu objects are available. The Added Objects dialog after installing is shown below, note that no Extensions are listed (x.EsriAddin attachment).
[ATTACH=CONFIG]27418[/ATTACH]

The Toolbar and Menu objects can be accessed and added from the Customize dialogue, as is expected, but the Extension does not show in the Extensions dialog:
[ATTACH=CONFIG]27422[/ATTACH]

I have tried the add-in extension example specified in the docs, with the same result. This example only contains an Extension, which causes the Added Objects dialog box to show the following (arcAddin.EsriAddin attachment):
[ATTACH=CONFIG]27419[/ATTACH]

As above the Extensions dialog does not show the Add-In Extension...

I have attached the corresponding files, as specified above.

System Specs:
ArcGIS 10.1 Desktop, SP1, 64bit Background Geoprocessing, Windows XP SP3
0 Kudos
5 Replies
JordanPorter
New Contributor III
I'm having the same issue.  Any ideas?
0 Kudos
by Anonymous User
Not applicable
Original User: swalbridge

The extension is working, but it looks like the one contained in those addin files doesn't have the "name" field changed, so it is using the default of "New Extension" (you can see that entry in the image provided). To change it, you can either: a) Update the "Name" field in the Add-In Wizard when creating a new extension or b) update the generated config.xml file directly in the root directory. You should see something like:

<Extension autoLoad="true" category="Python Addin" class="ExtensionClass1" id="x_addin.extension2" name="New Extension" ... />


update the text to whatever you'd like to show up in the dialog.

cheers,
Shaun
0 Kudos
StacyRendall1
Occasional Contributor III
Interesting!

I was in a rush when I did the post, and didn't see that when I took the screen shot! However, it is definitely not working all the time... I will do some more testing and post my findings.
0 Kudos
StacyRendall1
Occasional Contributor III
OK. To get an extension to show up in the Extension dialogue you have to close and re-open ArcMap after installing the add-in...

I also found that extensions will not show up at all in the Extension dialogue if there are errors, such as syntax errors, in the Python file for the add-in (which lives in the Install folder of the add-in). To test for these errors pass the file to the Python at the command line; if you get ImportError: No module named pythonaddins you don't have syntax errors (this is because the compiler checks for syntax errors before importing; I guess pythonaddins can only be imported from within ArcGIS, so it will fail here, getting to this point indicates that it has passed the syntax, etc., checks.)
0 Kudos
by Anonymous User
Not applicable
Original User: nivas_8383

Hi ,I faced the same issue.
I think you need to do this:
Open add-in manager, go to Options tab and check the option "Load all Add-ins without restrictions(Least secure)", then you can see all the addins you have installed.
0 Kudos