AddMessage (arcpy)
サマリ
Creates a geoprocessing informative message (Severity=0) that can be accessed with any of the GetMessages functions.
構文
AddMessage (message)
パラメータ | 説明 | データ タイプ |
message |
The message to add. | String |
コードのサンプル
AddMessage example
Add custom informative message to the Python script tool.
import arcpy
fc = arcpy.GetParameterAsText(0)
# Get the count from GetCount's Result object
feature_count = int(arcpy.GetCount_management(fc).getOutput(0))
if feature_count == 0:
arcpy.AddError("{0} has no features.".format(fc))
else:
arcpy.AddMessage("{0} has {1} features.".format(fc, feature_count))
関連トピック
4/26/2014