Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have created an Add-In using Python. However, when I edit the Python script for that Add-In and re-create the '.esriaddin' file, I don't get updated results when using that Add-In. Do I need to re-create the Add-In each time when I edit my Python script to cater to changes?

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

The steps for editing existing Python add-ins are described here.

One of those steps is to Test your add-in and the first step of that is to "Make the add-in file" by running the makeaddin.py script.

Consequently, I would expect that you do need to re-create the Add-in.

It is certainly worth giving that a try.

share|improve this answer
1  
Thanks. I learned from ESRI python forum that I have to restart ArcMap each time when I re-create Add-In using python. –  Ibe Jan 26 '13 at 3:22
add comment

In fact I found the other way to do it:

Adding to your script I just import module (but with fixed path) and do all your scripting in module. So it should look like that:

 def onClick(self):
    import imp
    print "start"
    mytestmodule = "mytestmodule.py"
    mymod = imp.load_source("mytestmodule", mypath+os.sep+mytestmodule)
    mymod.GetFrameName()

Now you can call any methods from module. Not sure yet if I can create a class there with onClick event?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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