Python Addin Error

4322
1
08-01-2013 10:40 AM
JacobDrvar
New Contributor II
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')
Tags (2)
0 Kudos
1 Reply
JoshuaPust
New Contributor III

I had a similar problem where my GP Tool Name in the properties didnt match my call. GP Tool has a name and label in the properties and I was calling the label because that what showed in Catalog within the toolbar.

0 Kudos