GetParameterAsText (arcpy)
サマリ
Gets the specified parameter by its index position from the list of parameters.
説明
To use the parameter as an object instead, see GetParameter.
構文
GetParameterAsText (index)
パラメータ | 説明 | データ タイプ |
index |
The numeric position of the parameter in the parameter list. | Integer |
データ タイプ | 説明 |
String |
The value of the specified parameter, returned as a string. |
コードのサンプル
GetParameterAsText example
Get specified parameter as text string.
import arcpy
from arcpy import env
import os
# Set the input workspace, get the feature class name to copy
# and the output location.
#
env.workspace = arcpy.GetParameterAsText(0)
inFeatureClass = arcpy.GetParameterAsText(1)
outLocation = arcpy.GetParameterAsText(2)
outFeatureClass = outLocation + os.sep + os.path.basename(inFeatureClass)
# Copy feature class to output location
#
arcpy.Copy_management(inFeatureClass, outFeatureClass)
関連トピック
9/14/2013