SetParameter (arcpy)

サマリ

Sets a specified parameter property by index using an object. This is used when passing objects from a script to a script tool. If you need to pass a text value to a script tool, use SetParameterAsText.

構文

SetParameter (index, value)
パラメータ説明データ タイプ
index

The specified parameter's index position in the parameter list.

Integer
value

The object that will set the specified parameter's property.

Object

コードのサンプル

SetParameter example

Pass object to specified tool parameter.

import arcpy

# Get the input feature class name.
#
fc = arcpy.GetParameterAsText(0)

# Obtain the spatial reference object and return it to the tool.
SR = arcpy.Describe(fc).spatialReference
arcpy.SetParameter(1, SR)

関連トピック

9/14/2013