erath

Calling custom tools within a python toolbox

Discussion created by erath on Jun 6, 2013
I have created several custom Python toolboxes with several tools in each toolbox. Within the execute method of a tool, I am able to call tools from another toolbox using the tool syntax (arcpy.tool_toolboxalias). But when I try to call a tool from a tool that is in the same toolbox, I get this error-

AttributeError: Object: Tool or environment <Tool_toolboxalias> not found

The error does not show up consistently. Sometimes the tool will work, and then after not changing any code I will get the error again.

I've tried importing the toolbox that I am working in (I would think that would not be necessary).

Has anyone else had this problem? Are you supposed to be able to call a tool from within the same toolbox? Should I be using OOP instead to call the execute method within the tool class?

Outcomes