Loading Toolbox within Script Tool for Use with Active ArcMap Session

244
0
05-08-2019 09:05 AM
NealBanerjee
Occasional Contributor

Hello,

I have a custom toolbox that I have created with a bunch (20+) of ModelBuilder tools.  I have created a Script Tool in Python that basically runs all of the individual tools in batch mode.  The script tool is stored in the same tool box (different tool set) than the individual components. 

In order to run the script tool successfully it seems I have to explicitly load the toolbox (arcpy.ImportToolbox(<name>.tbx)) even though Im running the script from the tool box that is already loaded in the current ArcMap document/session.  If I dont load it, I get the following error (the RskPreA_rarr is the name of my first model/tool)

Not that it is a big deal to load the toolbox, but this seems like rather odd behavoir that I dont recall happening before in other things Ive done.  Any insights on what is happening or if I am setting up something wrong?

Thanks

Neal

Tags (1)
0 Kudos
0 Replies