I'm having trouble adding a button using add-ins for a script tool that I made in ArcMap 10.4. I followed the instructions to the letter but I'm getting the error message "Failed to open tool [toolname] (mytoolbox.tbx). I don't understand why. I guess it's found the toolbox but won't run the tool. The code itself is very simple. It's just a reconstruction of the select by location tool to enable Geodesic selections (which really should be standard!) and the tool runs absolutely fine when I run it from the toolbox. The code to run the addin is a simple GPToolDialog call.
Here's the code for the add-in:
"""Implementation for SelectByLocation_addin.button (Button)"""
self.enabled = True
self.checked = False
I have double, triple and quadruple checked the spelling, path name and locations of all the relevant files. Just for your info here's the code for the python tool itself but like I say there;'s no issue running it from the toolbox:
If anyone can see what's wrong here I would very much appreciate any help with this.
Apologies for the formatting by the way. This is my first post and I can't figure out how to do the script boxes.Time to bang my head against a brick wall!