AnsweredAssumed Answered

errors importing custom tools from a ptyhon toolbox

Question asked by agomezl on Jul 21, 2014
Latest reply on Jul 21, 2014 by morehavoc

Hello Forum:

 

I'm getting errors importing custom tools from a ptyhon toolbox

 

 

My scenario si as follows:

 

I have developed 3 python toolboxes with some tools:

- PythonToolbox1 PT1 with Tool11 and Tool12  T11 T12

- PythonToolbox2 PT2 with Tool21 T21

- PythonToolbox3 PT3 with Tool31 T31

 

 

When calling T11 from T31 ( using importing arcpy.ImportToolbox(PT1)) the execution of T31 works fine

When calling T12 from T31 ( using importing arcpy.ImportToolbox(PT1)) the execution of T31 works fine

When calling T21 from T31 ( using importing arcpy.ImportToolbox(PT2)) the execution of T31 works fine

 

This is, when I call JUST ONE AND ONLY ONE tool, T31 works fine

 

 

 

But, if a tried to call more than one external tool from T31, I get errors:

 

When calling T11 and T12 from T31 ( using importing arcpy.ImportToolbox(PT1)) the execution of T31 works wrong (it executes T11 but not T12)

 

Traceback (most recent call last):

  File "<string>", line xxx, in execute

  File "C:\xxxx\PT1.pyt", line xx, in T12

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

 

 

 

 

When calling T11 and T21 from T31 ( using importing arcpy.ImportToolbox(PT1) and arcpy.ImportToolbox(PT2)) the execution of T31 works wrong (it executes T11 but not T21)

 

Traceback (most recent call last):

  File "<string>", line xxx, in execute

  File "C:\xxxx\PT2.pyt", line xx, in T21

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

 

 

 

I tried to use in T31 RemoveToolbox after using any call to a custom script,(and Import/Add Tool before calling them) but it still works wrong

 

 

It seems that one and only one external tool can be called from T31, but this make no sense.

 

Any ideas of this behaviour?

 

 

Thanks in advance

 

Antono

Outcomes