I am building an extension which depends on the availability of another extension (not from Esri) so I'd like to find out if another extension is available using Python.

Based on the availability of this other extension, I want to set the 'Enable' property of toolbar icons.

I tried to use the arcpy.CheckExtension('') however I am getting this message *Unrecognized extension code'. This is because I don't know the extension code.

Is there a way to list all the available or enabled extensions with their extension code?

Edited: From the Customize > Extensions.. I can see the extension is enabled (checked) but from python I like to find if it is enabled/checked. I tried arcpy.CheckExtension('') with displayed named but no luck.

| improve this question | | | | |
  • did you try to use try import exception – Hugo Roussaffa - GeoDatup Oct 22 '17 at 7:10
  • When you say "another extension (not from esri)" do you mean a Python AddIn extension written using ArcPy but not written by Esri, or something else? – PolyGeo Oct 22 '17 at 8:36
  • @PlyGeo: The extension is written in ArcObjects.NET to my knowledge.I am not fully dependent on this external extension but I like to know whether it is installed and available/enabled. – Musa Biralo Oct 22 '17 at 14:42
  • @HugoRoussaffa-GeoDatup: Please see the comments below. – Musa Biralo Oct 22 '17 at 14:42

To my knowledge there is no function in arcpy for return a list of Extensions. In the Help file under the syntax section for the CheckExtension() method it actually lists all the codes so you can test them individually.

I don't believe arcpy can determine which extensions are turned on/off at the Application level (i.e. in ArcMap).Happy to be proven wrong! Also there is no mechanism for ticking them on/off. I think arcpy, which to me is primarily for scripting, interacts with extensions in a different way and exposes geo-processing tools from the geo-processing framework rather than enabling controls on the user interface in ArcMap\ArcCatalog.

| improve this answer | | | | |

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.