Skip to main content

CopyParameter

汇总

按索引或参数名称将指定参数复制到脚本工具中的另一个参数中。 指定参数必须具有相同的数据类型。

语法

CopyParameter(from_param, to_param)

参数 说明 数据类型

from_param

The index position of the parameter, or the name of the parameter to be copied.

Integer

to_param

The index position of the parameter, or the name of the parameter that will be copied to.

Integer

代码示例

CopyParameter 示例

使用参数索引位置将输入参数复制到输出参数。

import arcpy

# Copy the script tool's specified input parameter object
# to the script tool's specified output parameter.
arcpy.CopyParameter(0, 1)
CopyParameter 示例

使用参数名称将输入参数复制到输出参数。 脚本工具有两个参数, param_aparam_b

import arcpy

# Copy the script tool's specified input parameter object
# to the script tool's specified output parameter.
arcpy.CopyParameter("param_a", "param_b")