I've got to either be missing something obvious or misunderstanding the use of notebook completely.
I'm trying to string a bunch of simple models together to run in notebook.
They run as expected in Model Builder, but they just return the two print statements within "try" without in the snippet below (path hidden and the <space> didn't past into the spoiler). Various models do different things (table exports, change shapefiles, pull data from different places, etc.) though they reside in the same toolbox. What'd I miss?
import arcpy
arcpy.env.overwriteOutput = True
arcpy.ImportToolbox("secret path to toolbox...", "tbx")
####Table Exports####
#ManatronExportsToAssessorTablesPro
#will not be needed once everything is converted to Pro
try:
print("start ManatronExportsToAssessorTablesPro")
arcpy.ManatronExportsToAssessorTablesPro_tbx
print("finish ManatronExportsToAssessorTablesPro")
except:
print("failed ManatronExportsToAssessorTablesPro")
Thanks,
Tycho
Solved! Go to Solution.
Sorry about the indentation. I basically just copied the image from the help doc here and thought it would work if I dumped it into Notepad.
And I missed the () at the end since none of the models needs an argument - added them and it works. So yep, missed something obvious from not paying attention (as usual).
you import toolboxes which is fine, but is this supposed to be a model?
arcpy.ManatronExportsToAssessorTablesPro_tbx
it definitely won't work since it doesn't need to be prefaced by arcpy
PS, providin proper formatting would be useful
Code formatting ... the Community Version - Esri Community
Sorry about the indentation. I basically just copied the image from the help doc here and thought it would work if I dumped it into Notepad.
And I missed the () at the end since none of the models needs an argument - added them and it works. So yep, missed something obvious from not paying attention (as usual).