GetMessages (arcpy)

サマリ

Returns the geoprocessing messages from a tool by specified severity level..

構文

GetMessages ({severity})
パラメータ説明データ タイプ
severity

The severity level of messages to return.

  • 0messages returned.
  • 1warning messages returned.
  • 2error messages returned.

Not specifying a severity will return all types of messages.

(デフォルト値は次のとおりです 0)

Integer
戻り値
データ タイプ説明
String

The geoprocessing tool messages, separated by a newline ('\n').

コードのサンプル

GetMessages example

Returns the geoprocessing messages.

import arcpy

fc = arcpy.GetParameterAsText(0)
featurecount = arcpy.GetCount_management(fc)

# Print all of the geoprocessing messages returned by the 
#  last tool (GetCount)
#
print arcpy.GetMessages()

関連トピック

9/14/2013