<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcMap Python Add In Extension does not execute in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191692#M14728</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for recycling the same old instructions I've posted &lt;A _jive_internal="true" href="https://community.esri.com/message/562379" target="_blank"&gt;here&lt;/A&gt;, but it does work for me:&lt;/P&gt;&lt;P&gt;1.) Make your extension in the add-in wizard&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/260074_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.) Customize the code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; pythonaddins

&lt;SPAN class="keyword token"&gt;class&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;ExtensionClass1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;object&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;"""Implementation for addin_test_addin.extension2 (Extension)"""&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;__init__&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# For performance considerations, please remove all unused methods in this class.&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;enabled &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;startup&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MessageBox&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Startup!'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'INFO'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;openDocument&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MessageBox&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Open document!'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'INFO'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;3.) Install the add-in&lt;/P&gt;&lt;P&gt;4.) Open ArcMap and enable the extension:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/260081_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;5.) Open a document to test the openDocument method. Restart ArcMap to test the startup method. They both work for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did notice one tricky part, and completely agree with your point that debugging add-ins is a pain. Once you've made the .esriaddin file by running makeaddin.py, the .esriaddin file does not automatically update itself. So, you need to run makeaddin.py and then .esriaddin if you want to see your new changes take effect in ArcMap.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 09:38:07 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2021-12-11T09:38:07Z</dc:date>
    <item>
      <title>ArcMap Python Add In Extension does not execute</title>
      <link>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191691#M14727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ArcMap Desktop 10.2, Windows 7, Python 2.7.3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attempting to set up a very basic add in extension for testing. I have used the Add In Wizard to establish the project folders/ files, run makeaddin.py and then run the .esriaddin to install the add in.&lt;/P&gt;&lt;P&gt;This is intended to open a message box and print a message to the python immediate window upon opening the mxd but I get nothing. It doesn't error out. It just never kicks off. I can see the Add In under Customize in the mxd.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Except for selecting the openDocument method I left all other inputs at the defaults. I've also tried this with the startup method and got the same non-result. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my script (indents not enforced):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;import pythonaddins&lt;/P&gt;&lt;P&gt;class ExtensionClass1(object):&lt;BR /&gt; """Implementation for TEST_addin.extension2 (Extension)"""&lt;BR /&gt; def __init__(self):&lt;BR /&gt; # For performance considerations, please remove all unused methods in this class.&lt;BR /&gt; self.enabled = True&lt;BR /&gt; def openDocument(self):&lt;BR /&gt; pythonaddins.MessageBox("blah blah blah TEST")&lt;BR /&gt; print "fake fake fake"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas here would be great. This is supposed to be the "easy" part as I haven't gotten into the complexities of my actual script that I'll be setting up at all.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOLLOW UP:&lt;/P&gt;&lt;P&gt;&amp;nbsp;Add ins are terrible to test. All testing must be done in the IDE as you are given no indication whatsoever what is wrong once you are working in ArcMap. I still have not really figured out all of the vagaries regarding why or why not something will not fire. For example, I have gotten the above script to run when I incorporate newDocument() above openDocument() with the same functional code, but if I then comment out newDocument it stops working. Nonsense.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It comes down to this: if you can see the Add in but not the Extension (assuming its an extension) then something is wrong with your script. However, I now have a new script which runs fine directly from the ArcMap immediate window but does nothing through the Add in. Nonsense. I suppose I'll just keep randomly guessing until it happens to work.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 17:03:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191691#M14727</guid>
      <dc:creator>danashney</dc:creator>
      <dc:date>2016-10-12T17:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap Python Add In Extension does not execute</title>
      <link>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191692#M14728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for recycling the same old instructions I've posted &lt;A _jive_internal="true" href="https://community.esri.com/message/562379" target="_blank"&gt;here&lt;/A&gt;, but it does work for me:&lt;/P&gt;&lt;P&gt;1.) Make your extension in the add-in wizard&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/260074_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.) Customize the code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; pythonaddins

&lt;SPAN class="keyword token"&gt;class&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;ExtensionClass1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;object&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;"""Implementation for addin_test_addin.extension2 (Extension)"""&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;__init__&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# For performance considerations, please remove all unused methods in this class.&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;enabled &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;startup&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MessageBox&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Startup!'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'INFO'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;openDocument&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MessageBox&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Open document!'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'INFO'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;3.) Install the add-in&lt;/P&gt;&lt;P&gt;4.) Open ArcMap and enable the extension:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/260081_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;5.) Open a document to test the openDocument method. Restart ArcMap to test the startup method. They both work for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did notice one tricky part, and completely agree with your point that debugging add-ins is a pain. Once you've made the .esriaddin file by running makeaddin.py, the .esriaddin file does not automatically update itself. So, you need to run makeaddin.py and then .esriaddin if you want to see your new changes take effect in ArcMap.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:38:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191692#M14728</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T09:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap Python Add In Extension does not execute</title>
      <link>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191693#M14729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have found testing to be 1000x easier since I&amp;nbsp;installed my Add-in using a network location, instead of manually!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Delete the add-in if you already installed it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Customise --&amp;gt; Add-in manager --&amp;gt; Options --&amp;gt; Search for additional add-ins in these folders"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Add the location that your "makeaddin.py" creates the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;.esriaddin file as a location.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;4) Now, if you run "makeaddin.py", then reboot arcmap, you are using the latest version of the code without having to do an extra click to install it!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 16:08:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191693#M14729</guid>
      <dc:creator>LukeWebb</dc:creator>
      <dc:date>2016-11-09T16:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap Python Add In Extension does not execute</title>
      <link>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191694#M14730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Luke,I have fewer steps that works well. &lt;/P&gt;&lt;OL&gt;&lt;LI&gt;first time, run makeaddin.py, then double clicke the &amp;lt;addin&amp;gt;.esriaddin&amp;nbsp;&amp;nbsp; Make sure it is checked on.&lt;/LI&gt;&lt;LI&gt;after changes to the script (but not to the toolbox itself)&lt;OL&gt;&lt;LI&gt;run make makeaddin.py&lt;/LI&gt;&lt;LI&gt;without closing the Map/Catalog,&amp;nbsp;&amp;nbsp;&amp;nbsp; Customize-&amp;gt;Add From File-&amp;gt;double-click the .esriaddin file&lt;/LI&gt;&lt;LI&gt;I can do this without having to close my map/catalog (which ever it was built for)&lt;/LI&gt;&lt;LI&gt;&lt;IMG alt="" class="image-1 jive-image" height="437" src="https://community.esri.com/legacyfs/online/260479_pastedImage_1.png" width="337" /&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;If you change the Toolbar itself, the above will work but you do need to close and reopen&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just another option.&amp;nbsp; Saves quite a bit of time when making tweaks, testing, repeat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reminder for those that do have to close/reopen your map/catalog often when testing tools or running lots of scripts or tools....make sure to clear out your Results tab often...then close and reopen.&amp;nbsp; All those results have to be saved and then re-read in every time you close/reopen.&amp;nbsp; Keeping it cleaned out can significantly increase the close/open process.&amp;nbsp; Just a tip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 16:33:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191694#M14730</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-11-09T16:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap Python Add In Extension does not execute</title>
      <link>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191695#M14731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the feedback all. You represent it as being obvious and strait forward, which it should be but it simply does not work. Darren, I have recreated your simple add in exactly and sometimes it installs correctly and shows up in extensions, others not. Seems like it depends on how I tilt my head. I've gotten to where I take it all the way back to the Addin Assitant every time since it seems like things get hung when I try to make in line changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the current iteration of what I'm actually trying to accomplish. If I input say, the newDocument() function directly into the ArcMap immediate window it does exactly what it is supposed to. If I install it as an add in it never shows up in the extensions.&lt;/P&gt;&lt;P&gt;This repoints layers from an old server to a new one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;import pythonaddins&lt;BR /&gt;import os&lt;/P&gt;&lt;P&gt;class serverUpdater(object):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; """Implementation for Server_Updater_addin.extension2 (Extension)"""&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # For performance considerations, please remove all unused methods in this class.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.enabled = True&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def newDocument(self):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connections =&amp;nbsp;my directory&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; modeling_PROD1 =&amp;nbsp;sde connection&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROD1_connection = os.path.join(connections,modeling_PROD1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mxd = arcpy.mapping.MapDocument("CURRENT")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for lyr in arcpy.mapping.ListLayers(mxd):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.supports("SERVICEPROPERTIES") and lyr.serviceProperties['Server'] == "BESDBTEST1":&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print lyr.name&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name = lyr.dataSource.split(".")[-1]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.replaceDataSource(PROD1_connection,"SDE_WORKSPACE", name)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Replaced source for: " + lyr.name&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter = counter + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if counter &amp;gt; 0:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;arcpy.RefreshTOC()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;arcpy.RefreshActiveView()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;mxd.save()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;pythonaddins.MessageBox("BESDBTEST1 sources have been re-sourced to BESDBPROD1;&amp;nbsp; see python window for details","SERVER SOURCE UPDATE",0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;def openDocument(self):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;connections =&amp;nbsp;my directory&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; modeling_PROD1 =&amp;nbsp;sde connection&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROD1_connection = os.path.join(connections,modeling_PROD1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;mxd = arcpy.mapping.MapDocument("CURRENT")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for lyr in arcpy.mapping.ListLayers(mxd):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.supports("SERVICEPROPERTIES") and lyr.serviceProperties['Server'] == "BESDBTEST1":&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print lyr.name&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name = lyr.dataSource.split(".")[-1]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.replaceDataSource(PROD1_connection,"SDE_WORKSPACE", name)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Replaced source for: " + lyr.name&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter = counter + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if counter &amp;gt; 0:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;arcpy.RefreshTOC()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;arcpy.RefreshActiveView()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;mxd.save()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;pythonaddins.MessageBox("BESDBTEST1 sources have been re-sourced to BESDBPROD1;&amp;nbsp; see python window for details","SERVER SOURCE UPDATE",0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;- I got it to show up in the Extensions but when I attempt to run it through the event (open/newDocument) I get...nothing. The way I got it to at least show up in Exentions was to drop it into pyScripter instead of Notepadd ++ which gave me different syntax errors regarding indentation. Had to unindent and re-indent back to, as far as I could tell, the exact same spot but it cleaned it up. Anyway, I'm done with trying for the event extension. I set it up to run from a button instead which works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My 2 cents: Add ins Extensions&amp;nbsp;are majorly broken in their current configuration. There is&amp;nbsp;absolutely no error handling whatsoever for extensions from what I saw. I at least got minimal error messaging when working on the button. Testing consists of attempting to run it, seeing nothing happen, then going back to the script for&amp;nbsp;a round of randomly guessing what could be the issue. I would not recommend this tool to anyone. I've sunk a ridiculous amount of time into doing something that at its face should be strait forward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to everyone who attempted to help. &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 17:44:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191695#M14731</guid>
      <dc:creator>danashney</dc:creator>
      <dc:date>2016-11-09T17:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap Python Add In Extension does not execute</title>
      <link>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191696#M14732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you had issues with indentation in pyscripter&amp;nbsp;using your notepad ++ file, it sounds like you have got your notepad setup wrong for python!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, you are mixing "Tabs" with "Spaces"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fix --&amp;gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open notepad ++&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Settings" --&amp;gt; "Preferences" --&amp;gt; "Language Menu / Tab Settings"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Find Python&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the right, tick the box "replace by space" and choose a number of spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when you use tab, it will behind the scenes put in spaces, and make sure that what you see is exactly as python will read the indentation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2016 10:45:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191696#M14732</guid>
      <dc:creator>LukeWebb</dc:creator>
      <dc:date>2016-11-10T10:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap Python Add In Extension does not execute</title>
      <link>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191697#M14733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Luke.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 20:47:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcmap-python-add-in-extension-does-not-execute/m-p/191697#M14733</guid>
      <dc:creator>danashney</dc:creator>
      <dc:date>2016-12-06T20:47:01Z</dc:date>
    </item>
  </channel>
</rss>

