Is This Content Helpful?
We're glad to know this article was helpful.
In some situations it is often easier to call a ModelBuilder model in a Python script rather than converting an entire model to a Python script. This technical article describes how to do this.
ModelBuilder models are stored in a custom toolbox, and to call them within the Python script the arcpy.AddToolbox() function is required.
tbx = arcpy.AddToolbox("C:/Temp/MyTools.tbx")
The model can also be called up using the alias name for the toolbox (arcpy.toolbox_alias). It is a best practice to add an alias name to the toolbox.
inFC = "C:/Temp/input.shp"