toolboxPath = os.path.join(os.path.dirname(__file__), toolboxName + ".pyt")
Solved! Go to Solution.
relPath = os.path.dirname(__file__) pyt = relPath + os.sep + "customToolbox.pyt" pythonaddins.GPToolDialog(pyt, "Tool") # Tool is the class name
Also, ensure that the .pyt is in the add-in file. You can check that by renaming the extension .zip and examining the contents.
def onClick(self): # name of toolbox toolboxName = "Condos" # name of tool to be executed (the class in Condos.pyt) toolName = "CondoTool" # create string with path to toolbox relPath = os.path.dirname(__file__) pyt = relPath + os.sep + toolboxName + ".pyt" # call geoprocessing tool pythonaddins.GPToolDialog(pyt, toolName) pass