ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Ayuda
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plataforma de representación cartográfica para tu organización

ArcGIS Desktop

Un completo SIG profesional

ArcGIS Enterprise

SIG en tu empresa

ArcGIS Developers

Herramientas para crear aplicaciones basadas en la ubicación

ArcGIS Solutions

Plantillas de aplicaciones y mapas gratuitas para tu sector

ArcGIS Marketplace

Obtén aplicaciones y datos para tu organización.

  • Documentación
  • Soporte
Esri
  • Iniciar sesión
user
  • Mi perfil
  • Cerrar sesión

ArcMap

  • Inicio
  • Introducción
  • Cartografiar
  • Analizar
  • Administrar datos
  • Herramientas
  • Extensiones

AddReturnMessage

  • Resumen
  • Debate
  • Sintaxis
  • Muestra de código

Resumen

Sets the return message of a script tool as an output message by index.

Debate

There are times when you may want to return all messages from a tool you've called, regardless of message severity. Using the index parameter, AddReturnMessage will return a message from the last tool executed. The severity of the message (warning, error, and so on, is preserved).

Geoprocessing error numbers shown in the progress dialog box are hyperlinks to a help page that further describes the error. To enable hyperlinks for errors in your script, use the AddReturnMessage function instead of the AddError function, as follows:

import arcpy
try:    
    result = arcpy.GetCount_management("c:/data/rivers.shp")

except:    
    # Return Geoprocessing tool specific errors
    #
    for msg in range(0, arcpy.GetMessageCount()):
        if arcpy.GetSeverity(msg) == 2:
            arcpy.AddReturnMessage(msg)

Sintaxis

AddReturnMessage (index)
ParámetroExplicaciónTipo de datos
index

The message index.

Integer

Muestra de código

AddReturnMessage example

Returns all messages from the last tool executed as script tool output messages.

import arcpy

# Set current workspace
arcpy.env.workspace = "c:/data/base.gdb"

arcpy.Buffer_analysis("roads", "roads_buffer_1000", "1000 feet")

# Return the resulting messages as script tool output messages
for i in range(0, arcpy.GetMessageCount()):
    arcpy.AddReturnMessage(i)

Temas relacionados

  • AddError
  • AddIDMessage
  • AddMessage
  • AddWarning
  • GetMessage
  • GetMessageCount
  • GetMessages
  • GetReturnCode
  • Escribir mensajes en las herramientas de secuencia de comandos
  • Comprender los tipos de mensajes y su severidad
  • Comprender mensajes en las herramientas de secuencia de comandos

ArcGIS Desktop

  • Inicio
  • Documentación
  • Soporte

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

Acerca de Esri

  • Quiénes somos
  • Empleo
  • Blog de Esri
  • Conferencia de usuarios
  • Cumbre de desarrolladores
Esri
Díganos su opinión.
Copyright © 2021 Esri. | Privacidad | Legal