I have a ArcGIS Pro model which takes a polygon shapefile (Site_boundary_master) and spatially joins various layers to it, finally exporting the final output to an Excel spreadsheet:
All the joining layers are kept in various File Geodatabases.
I saved the model as 'AutomationModel' (but in the properties dialogue for it, it's called 'Model222') in a toolbox called 'Automation.tbx'.
Running the model from ModelBuilder works fine.
I then created a .py python file (from a blank .txt file) and wrote a script to run this model this way:
import arcpy
print ('Script started')
# import the toolbox
arcpy.ImportToolbox(r"C:\Automation\Automation.tbx")
print ('Toolbox imported')
#import the model
arcpy.Automation.Model222()
print ('Model imported')
print ('Script finished')
Pasting this code into the ArcGIS Pro python console, it work fine. Again.
However, when I edit the .py file in IDLE (ArcGIS Pro) and then run the script, it doesn't work at all:
Is it because I need to tell the script where all the input layers are stored?
I'm still a novice with Python.