How to reference a tool in same toolbox (pyt)?

146
1
Jump to solution
07-18-2019 10:45 AM
CharlieHarper3
New Contributor II

Hi All,

Can anyone tell me how to call tool1 from tool2 in the same pyt file? I'm not seeing any documentation for this and my assumption that it would be called like any other tool via arcpy isn't right.

Thanks!

0 Kudos
1 Solution

Accepted Solutions
CharlieHarper3
New Contributor II

In case anyone else encounters this, I was able to force it with:

pyt_file = os.path.basename(__file__)
arcpy.ImportToolbox(pyt_file)

View solution in original post

0 Kudos
1 Reply
CharlieHarper3
New Contributor II

In case anyone else encounters this, I was able to force it with:

pyt_file = os.path.basename(__file__)
arcpy.ImportToolbox(pyt_file)
0 Kudos