Call a ModelBuilder model in a Python script
【相关信息】
Article ID: 46226
Software:
ArcGIS for Desktop Advanced 10.2, 10.2.1, 10.3, 10.3.1, 10.4, 10.2.2
Platforms:
Windows Windows 8, Windows 8.1, Windows 10
【问题描述】
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.
Article ID: 46226
Software:
ArcGIS for Desktop Advanced 10.2, 10.2.1, 10.3, 10.3.1, 10.4, 10.2.2
Platforms:
Windows Windows 8, Windows 8.1, Windows 10
【问题描述】
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.
1 个回复
易智瑞技术支持
赞同来自:
ModelBuilder models are stored in a custom toolbox, and to call them within the Python script the arcpy.AddToolbox() function is required.
1. Create a variable referencing the toolbox.
2. Call the model using the variable created in the previous step. In this example 'Model' is the name of the model.
3. If a model requires a user input, create a variable in the Python script and pass that as the argument to the model parameter. For example, the following code sample passes an input feature class into the copy features tool in the model.
【其它相关参考】
【创建及修改时间】
Created: 2/2/2016 Last Modified: 3/4/2016
【原文链接】
http://support.esri.com/en/kno ... 46226
要回复问题请先登录或注册