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

AddError

  • Resumen
  • Sintaxis
  • Muestra de código

Resumen

Adds an error message (severity of 2) to the messages of a script tool or Python toolbox tool.

When a tool is run, arcpy is fully aware of the application from which it is called. One major effect of this is that you can write messages in Python and your messages automatically appear on the tool dialog box, in the history, and in the Python window.

Sintaxis

AddError (message)
ParámetroExplicaciónTipo de datos
message

The error message to add.

String

Muestra de código

AddError example

Add a custom geoprocessing error message.

import arcpy

fc = arcpy.GetParameterAsText(0)

# Get the count from the GetCount tool's Result object
feature_count = int(arcpy.GetCount_management(fc)[0])

if feature_count == 0:
    arcpy.AddError("{0} has no features.".format(fc))
else:
    arcpy.AddMessage("{0} has {1} features.".format(fc, feature_count))

Temas relacionados

  • AddIDMessage
  • AddMessage
  • AddReturnMessage
  • 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