GetParameter
摘要
From the parameter list, select the desired parameter by its index value. The parameter is returned as an object.
讨论
To use the parameter as a text string instead, see GetParameterAsText.
语法
GetParameter (index)
参数 | 说明 | 数据类型 |
index |
Selects the specified parameter, by its index, from the parameter list. | Integer |
数据类型 | 说明 |
Object |
Object is returned from specified parameter. |
代码示例
GetParameter example
Get script tool parameter as object.
import arcpy # Get the spatial reference from the tool dialog. # SR = arcpy.GetParameter(0) # Display the Spatial Reference properties # arcpy.AddMessage(SR.name) arcpy.AddMessage(SR.type) arcpy.AddMessage(SR.factoryCode)
相关主题
7/10/2012