ArcGIS Python Add-In enabled / autoLoad behaviourCheckout Spatial Analyst extention, ArcObjects...

Have any astronauts or cosmonauts died in space?

A cancellation property for permutations?

Can I legally make a website about boycotting a certain company?

How can I make my enemies feel real and make combat more engaging?

Have the UK Conservatives lost the working majority and if so, what does this mean?

Coworker is trying to get me to sign his petition to run for office. How to decline politely?

Is there a way to pause a running process on Linux systems and resume later?

Why are "square law" devices important?

Was the Soviet N1 really capable of sending 9.6 GB/s of telemetry?

Multiplying elements of a list

Why do we divide Permutations to get to Combinations?

Isn't a semicolon (';') needed after a function declaration in C++?

Why are `&array` and `array` pointing to the same address?

Calculating total "on row" bytes for each row ... the easy way

Are Kickstages exclusive to Rocketlabs Electron Design?

How Create a list of the first 10,000 digits of Pi and sum it?

Will linear voltage regulator step up current?

In the Lost in Space intro why was Dr. Smith actor listed as a special guest star?

Now...where was I?

How do I avoid the "chosen hero" feeling?

How do I add a strong "onion flavor" to the biryani (in restaurant style)?

How can a kingdom keep the secret of a missing monarch from the public?

Is corrosion inhibitor paste conductive?

How does the spell Slow affect freefall?



ArcGIS Python Add-In enabled / autoLoad behaviour


Checkout Spatial Analyst extention, ArcObjects codeIExtension.Startup() not launching when ArcMap starts?ArcGIS 10 add-in: ComboBox add-in component focus issueSpawning a process from ArcGIS ToolValidatorHow to attach GP script tools, standard tools, and Python script to a toolbar?Can't Remove a Menu in Python Add-inWhen debugging ArcGIS add-in, can't use “Edit and Continue”How are the GUID values for AddIn extensions created?Enabling ArcGIS Spatial Analyst extension by default?Communicating with separate ArcGIS Add-in?













0















I have a Python add-in that includes an extension class. The only purpose of this extension is for some buttons in the add-in to be automatically enabled/disabled depending on if there are relevant layers in the current MXD's table on contents (by using the extension's itemAdded() and itemDeleted() functions).



Therefore I need this extension to be loaded automatically AND enabled when this add-in is installed.



In the config.xml, 'autoLoad' is set to 'true'. In the Python class, the init function for the extension class includes:



self.enabled = True


I thought this should be enough for it to work as I wanted.



However, when I install the add-in and re-launch ArcMap, the extensions dialog shows the extension but NOT checked.



Now, I have found that if I run something like:



myExtension.enabled = True


Within the __init__ method of some other toolbar class (eg, one of the buttons, NOT the extension class), then the extension IS CHECKED in the extensions dialog when ArcMap is re-launched! However, it doesn't actually work - it's functions are not called. But, if I then quit ArcMap and restart ArcMap, the extension is both checked in the dialogue AND fully functional (presumably because it remained enabled from the previous run of ArcMap).



So I can get the desired behaviour ONLY if I do ALL of the following ODD things:




  • enable the extension in the class of some other add-in button (NOT just in the extension class itself)

  • launch ArcMap

  • quit ArcMap

  • launch ArcMap


After that it works fine on subsequent launches of ArcMap.



Is it possible to get a Python add-in extension to automatically load and be enabled by default when the add-in is installed by any other means, and to have it work the first time ArcMap is launched after the add-in is installed?









share



























    0















    I have a Python add-in that includes an extension class. The only purpose of this extension is for some buttons in the add-in to be automatically enabled/disabled depending on if there are relevant layers in the current MXD's table on contents (by using the extension's itemAdded() and itemDeleted() functions).



    Therefore I need this extension to be loaded automatically AND enabled when this add-in is installed.



    In the config.xml, 'autoLoad' is set to 'true'. In the Python class, the init function for the extension class includes:



    self.enabled = True


    I thought this should be enough for it to work as I wanted.



    However, when I install the add-in and re-launch ArcMap, the extensions dialog shows the extension but NOT checked.



    Now, I have found that if I run something like:



    myExtension.enabled = True


    Within the __init__ method of some other toolbar class (eg, one of the buttons, NOT the extension class), then the extension IS CHECKED in the extensions dialog when ArcMap is re-launched! However, it doesn't actually work - it's functions are not called. But, if I then quit ArcMap and restart ArcMap, the extension is both checked in the dialogue AND fully functional (presumably because it remained enabled from the previous run of ArcMap).



    So I can get the desired behaviour ONLY if I do ALL of the following ODD things:




    • enable the extension in the class of some other add-in button (NOT just in the extension class itself)

    • launch ArcMap

    • quit ArcMap

    • launch ArcMap


    After that it works fine on subsequent launches of ArcMap.



    Is it possible to get a Python add-in extension to automatically load and be enabled by default when the add-in is installed by any other means, and to have it work the first time ArcMap is launched after the add-in is installed?









    share

























      0












      0








      0








      I have a Python add-in that includes an extension class. The only purpose of this extension is for some buttons in the add-in to be automatically enabled/disabled depending on if there are relevant layers in the current MXD's table on contents (by using the extension's itemAdded() and itemDeleted() functions).



      Therefore I need this extension to be loaded automatically AND enabled when this add-in is installed.



      In the config.xml, 'autoLoad' is set to 'true'. In the Python class, the init function for the extension class includes:



      self.enabled = True


      I thought this should be enough for it to work as I wanted.



      However, when I install the add-in and re-launch ArcMap, the extensions dialog shows the extension but NOT checked.



      Now, I have found that if I run something like:



      myExtension.enabled = True


      Within the __init__ method of some other toolbar class (eg, one of the buttons, NOT the extension class), then the extension IS CHECKED in the extensions dialog when ArcMap is re-launched! However, it doesn't actually work - it's functions are not called. But, if I then quit ArcMap and restart ArcMap, the extension is both checked in the dialogue AND fully functional (presumably because it remained enabled from the previous run of ArcMap).



      So I can get the desired behaviour ONLY if I do ALL of the following ODD things:




      • enable the extension in the class of some other add-in button (NOT just in the extension class itself)

      • launch ArcMap

      • quit ArcMap

      • launch ArcMap


      After that it works fine on subsequent launches of ArcMap.



      Is it possible to get a Python add-in extension to automatically load and be enabled by default when the add-in is installed by any other means, and to have it work the first time ArcMap is launched after the add-in is installed?









      share














      I have a Python add-in that includes an extension class. The only purpose of this extension is for some buttons in the add-in to be automatically enabled/disabled depending on if there are relevant layers in the current MXD's table on contents (by using the extension's itemAdded() and itemDeleted() functions).



      Therefore I need this extension to be loaded automatically AND enabled when this add-in is installed.



      In the config.xml, 'autoLoad' is set to 'true'. In the Python class, the init function for the extension class includes:



      self.enabled = True


      I thought this should be enough for it to work as I wanted.



      However, when I install the add-in and re-launch ArcMap, the extensions dialog shows the extension but NOT checked.



      Now, I have found that if I run something like:



      myExtension.enabled = True


      Within the __init__ method of some other toolbar class (eg, one of the buttons, NOT the extension class), then the extension IS CHECKED in the extensions dialog when ArcMap is re-launched! However, it doesn't actually work - it's functions are not called. But, if I then quit ArcMap and restart ArcMap, the extension is both checked in the dialogue AND fully functional (presumably because it remained enabled from the previous run of ArcMap).



      So I can get the desired behaviour ONLY if I do ALL of the following ODD things:




      • enable the extension in the class of some other add-in button (NOT just in the extension class itself)

      • launch ArcMap

      • quit ArcMap

      • launch ArcMap


      After that it works fine on subsequent launches of ArcMap.



      Is it possible to get a Python add-in extension to automatically load and be enabled by default when the add-in is installed by any other means, and to have it work the first time ArcMap is launched after the add-in is installed?







      python arcmap add-in





      share












      share










      share



      share










      asked 2 mins ago









      Son of a BeachSon of a Beach

      1,471618




      1,471618






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "79"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313152%2farcgis-python-add-in-enabled-autoload-behaviour%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313152%2farcgis-python-add-in-enabled-autoload-behaviour%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          is 'sed' thread safeWhat should someone know about using Python scripts in the shell?Nexenta bash script uses...

          Meter-Bus Содержание Параметры шины | Стандартизация |...