SetParameter

此 ArcGIS 2.7 文档已 存档,并且不再对其进行更新。 其中的内容和链接可能已过期。 请参阅最新文档

描述

用于使用对象按索引来设置指定参数属性。此函数用于将对象从脚本传递到脚本工具。如果您需要传递字符串,请使用 SetParameterAsText 函数。

语法

SetParameter (index, value)
参数说明数据类型
index

参数列表中指定参数的索引位置。

Integer
value

将设置指定参数属性的对象。

Object

代码示例

SetParameter 示例

将对象传递到指定工具参数。

import arcpy
# Get the input feature class name.
fc = arcpy.GetParameterAsText(0)
# Obtain the spatial reference object and return it to the tool.
spatial_ref = arcpy.Describe(fc).spatialReference
arcpy.SetParameter(1, spatial_ref)

相关主题