ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

GetMessages

  • Summary
  • Syntax
  • Code sample

Summary

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

Syntax

GetMessages ({severity})
ParameterExplanationData Type
severity

The severity level of messages to return.

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

Not specifying a severity will return all types of messages.

(The default value is 0)

Integer

Return Value

Data TypeExplanation
String

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

Code sample

GetMessages example

Returns the geoprocessing messages.

import arcpy

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

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

Related topics

  • AddError
  • AddIDMessage
  • AddMessage
  • AddReturnMessage
  • AddWarning
  • GetMessage
  • GetMessageCount
  • GetReturnCode
  • Writing messages in script tools
  • Understanding message types and severity
  • Understanding messages in script tools

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal