jdrvar

Python Addin Error

Discussion created by jdrvar on Aug 1, 2013
Latest reply on Dec 31, 2014 by josh.pust
I have a Toolbar with five buttons created and loaded through Python Addin (ArcMap 10.1).  The last tool has the image, shows the caption, but an error pops up when the tool is clicked.  The Error reads, "Failed to open tool TRSearch.py(BCPAO.tbx).  The name of the tool is TRSearch.py and is located within the BCPAO toolbox.  The python script is saved within the same folder as the other scripts and the name is correct.  All of the other buttons work.  Any ideas why the TRSearch.py button does not work?  I have included my Addin script.

import arcpy
import pythonaddins

class ButtonClass(object):
    """Implementation for BCPAO_addin.button (Button)"""
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
        pythonaddins.GPToolDialog(r'E:\User\Python\ArcGIS10.1_Scripts\BCPAO.tbx', 'ParcelSearch.py')

class ButtonClass1(object):
    """Implementation for BCPAO_addin.button_1 (Button)"""
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
        pythonaddins.GPToolDialog(r'E:\User\Python\ArcGIS10.1_Scripts\BCPAO.tbx', 'SectionSearch.py')

class ButtonClass2(object):
    """Implementation for BCPAO_addin.button_2 (Button)"""
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
        pythonaddins.GPToolDialog(r'E:\User\Python\ArcGIS10.1_Scripts\BCPAO.tbx', 'CalculateArea.py')

class ButtonClass3(object):
    """Implementation for BCPAO_addin.button_3 (Button)"""
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
        pythonaddins.GPToolDialog(r'E:\User\Python\ArcGIS10.1_Scripts\BCPAO.tbx', 'NameDate.py')

class ButtonClass4(object):
    """Implementation for BCPAO_addin.button_4 (Button)"""
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
        pythonaddins.GPToolDialog(r'E:\User\Python\ArcGIS10.1_Scripts\BCPAO.tbx', 'TRSearch.py')

Outcomes