GetMessage (arcpy)

摘要

Returns a geoprocessing tool message by its index position.

语法

GetMessage (index)
参数说明数据类型
index

The message to retrieve.

Integer
返回值
数据类型说明
String

The geoprocessing tool message.

代码实例

GetMessage example

Returns specified geoprocessing messages.

import arcpy

fc = arcpy.GetParameterAsText(0)

# Run the GetCount tool
#
result = arcpy.GetCount_management(fc)

# Print the first and last message returned by the last 
#  tool executed (GetCount)
#
messageCount = arcpy.GetMessageCount()

# Print the first message
#
print arcpy.GetMessage(0)

# Print the last message
#
print arcpy.GetMessage(messageCount - 1)

相关主题

9/15/2013