Select to view content in your preferred language

Python toolbox - tool connection is broken when open ArcGIS Pro

1868
6
07-10-2021 04:53 AM
Rakefet
Emerging Contributor

Hi,

I created a Python toolbox with multiple tools and connect it to my project. When I save my project and open it again, the toolbox is shown in the catalog but when I click on it to see the tools , I am getting the broken connect symbol. I still can select edit and see my script but I can not use the tool because the connect is broken. If I right-click on the tool to see the properties, the connection is back. Any idea why this is happening?  
I am using ARcGIS pro 2.8. This bug is new. I used this toolbox a month ago with no problem.

 

thank for any inputs

0 Kudos
6 Replies
DanPatterson
MVP Esteemed Contributor

same project? same toolbox pre and post update?

location of the toolbox relative to the location of the aprx?

spaces or other unsafe characters in the path or toolbox name?

I just checked all mine with no issue at all


... sort of retired...
0 Kudos
Rakefet
Emerging Contributor

Thanks for the quick respond.

Same project and same toolbox. Maybe updated it a little. The pyt file is in a different folder than the aprx.  For demonstration,  I just created a test.pyt file with mytest tool, saved the project and opened it again:

Capture1.JPG

after right click and refreshing test.pyt,  I am getting the connection back:

Capture2.JPG

0 Kudos
DanPatterson
MVP Esteemed Contributor

no wonder.... you were trying to put a toolbox in a custom toolbox

What is a Python toolbox?—ArcGIS Pro | Documentation

don't... when you make a python toolbox, you just add it to the project


... sort of retired...
Rakefet
Emerging Contributor

Thanks. I added the tool to the project and it still did not work. What did the trick was deleting the line code:  map = aprx.activeMap

0 Kudos
DanPatterson
MVP Esteemed Contributor

I guess showing the code would have been useful too 😉


... sort of retired...
0 Kudos
Rakefet
Emerging Contributor

the curse of cut and paste from an old script...

 

0 Kudos