3

I've been asked by somebody at work to design a toolbar add-in that works just the same as an existing one, but with a different set of data. However, the person who wrote the original add-in for him has left the company, and did not document his work at all.

The only thing available to me is the MXD. How do I find what Python script(s) is triggered by a toolbar add-in, and where the script lives? (The requester is working in ArcMap 9.3, and while I have ArcMap 10.2 available to me, I have to design to 9.3 so he'll be able to use it.)

An obvious workaround is just writing something new from scratch. The desired workflow is fairly simple: iterate through a bunch of groups of data and make a PDF, thereby automating the process of making 100+ maps. But just like this analyst is simplifying his job by using a one-click button, I'd like to simplify my job by basing the new script on the existing, proven script :-)

  • 1
    is it a Python add-in or a .NET add-in? I am confused because I cannot understand how he is supposed to use the Python add-in in 9.3 which was introduced in 10.1 :) – Alex Tereshenkov Jan 29 '15 at 13:58
  • Is the add-in loaded into the MXD you have? – landocalrissian Jan 29 '15 at 14:02
  • @AlexTereshenkov The user knows that the button operates/triggers a Python script (he was told that much), just not where that script is or what it's named (because he doesn't maintain/update it). It's entirely likely I'm using the wrong terminology because I've only worked with Python add-ins in 10.1+ previously. – Erica Jan 29 '15 at 14:34
  • @ChrisR Yes, the add-in is loaded into the MXD. – Erica Jan 29 '15 at 14:35
  • 1
    see here. But I am pretty sure the python script associated with the toolbar is not installed. – Barbarossa Jan 29 '15 at 15:15
3

In the requester's mxd, if you go to the Customize drop-down and then select Customize Mode (This is in 10.1. I can't remember if 9.3 was exactly the same, but either way look for Customize Mode somewhere), and then right-click on the button in the toolbar do you get the option to View Source?

At 9.3 you could make buttons that fired VBA which in turn fired a python tool, and "view source" will show that code. Could this be what is going on? http://www.geospatialtraining.com/blog/index.php/adding-a-python-script-to-a-new-toolbar-in-arcview-9-3-1-tutorial/

  • YES. This is indeed what's going on. Thanks! (In 9.3, it's just Tools -> Customize, then right-clicking on the button etc.) – Erica Jan 29 '15 at 15:12
  • Any chance that anyone would know what to do if 'View Source' is greyed out? I'm in a very similar situation to Erica. :/ – MaryBeth Feb 12 '15 at 13:20
  • MaryBeth, my guess is because the tool wasn't created using VBA saved in the .mxd. Prior to the Esri Add-Ins method, another way to deploy tools was with an installer that would install a .dll on the machine that would be loaded with ArcMap, and I know less about this method. You might want to pose this as a separate question. – Dan Jurgella Feb 12 '15 at 16:35
3

Python add-ins are new to 10.1. So your 9.3 user won't be able to use one. If he decides to migrate to 10.1 or higher (wouldn't be a bad thing after all, 9.3 is not supported for a while):

Add-ins are stored in your user's profile (...\My Documents\ArcGIS\AddIns). I don't think you can use/find the add-in if you didn't install it on your machine.

But if you find this .esriaddin file (in the AddIn folder mentioned above, in an old email from your ex colleague), just unzip it, you will find the .py script it uses.

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.