概要
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. |
コードのサンプル
Get script tool parameter as object.
import arcpy
# Get the spatial reference from the tool dialog.
spatial_ref = arcpy.GetParameter(0)
# Display the Spatial Reference properties
arcpy.AddMessage("Name is: {0}".format(spatial_ref.name))
arcpy.AddMessage("Type is: {0}".format(spatial_ref.type))
arcpy.AddMessage("Factory code is: {0}".format(spatial_ref.factoryCode))