ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Hilfe
  • Sign Out
ArcGIS Desktop

ArcGIS Online

Die Mapping-Plattform für Ihre Organisation

ArcGIS Desktop

Ein vollständiges professionelles GIS

ArcGIS Enterprise

GIS in Ihrem Unternehmen

ArcGIS for Developers

Werkzeuge zum Erstellen standortbezogener Apps

ArcGIS Solutions

Kostenlose Karten- und App-Vorlagen für Ihre Branche

ArcGIS Marketplace

Rufen Sie Apps und Daten für Ihre Organisation ab.

  • Dokumentation
  • Support
Esri
  • Anmelden
user
  • Eigenes Profil
  • Abmelden

ArcMap

  • Startseite
  • Erste Schritte
  • Karte
  • Analysieren
  • Verwalten von Daten
  • Werkzeuge
  • Erweiterungen

AddIDMessage

  • Zusammenfassung
  • Auswertung
  • Syntax
  • Codebeispiel

Zusammenfassung

Allows you to use system messages with a script tool.

Auswertung

Geoprocessing errors and warnings are returned from geoprocessing tools with a six-digit code and a text message. Every error and warning has a corresponding description page in the desktop help system. This page contains both a detailed description of the error and possible solutions for the error. In tool dialog boxes, the Python window, and the Results window, the ID code is a link that, when clicked, takes you to a description page.

Syntax

AddIDMessage (message_type, message_ID, {add_argument1}, {add_argument2})
ParameterErklärungDatentyp
message_type

The message type defines whether the message will be an error, warning, or informative. Valid message types are the following:

  • ERROR —Adds an error message to the tool messages
  • INFORMATIVE —Adds an informative message to the tool messages
  • WARNING —Adds a warning message to the tool messages
String
message_ID

The message ID allows you to reference existing messages for your scripting errors and warnings.

Integer
add_argument1

Depending on which message ID is used, an argument may be necessary to complete the message. Common examples include dataset or field names. Data type can be string, integer, or double.

Object
add_argument2

Depending on which message ID is used, an argument may be necessary to complete the message. Common examples include dataset or field names. Data type can be string, integer, or double.

Object

Codebeispiel

AddIDMessage example

Add a message to a Python script tool.

class overwriteError(Exception):
    pass

import arcpy

in_feature_class = arcpy.GetParameterAsText(0)
out_feature_class = arcpy.GetParameterAsText(1)

try:
    # If the output feature class already exists, raise an error
    if arcpy.Exists(in_feature_class):
        # Raise a custom exception
        raise overwriteError(out_feature_class)
    else:
        arcpy.CopyFeatures_management(in_feature_class, out_feature_class)

except overwriteError as err:
    # Use message ID 12, and provide the output feature class
    #    to complete the message.
    arcpy.AddIDMessage("Error", 12, str(err))

Verwandte Themen

  • AddError
  • AddMessage
  • AddReturnMessage
  • AddWarning
  • GetMessage
  • GetMessageCount
  • GetMessages
  • GetReturnCode
  • Ausgeben von Meldungen in Skriptwerkzeugen
  • Meldungstypen und Meldungsgewichtung
  • Meldungen in Skriptwerkzeugen
  • GetIDMessage

ArcGIS Desktop

  • Startseite
  • Dokumentation
  • Support

ArcGIS Plattform

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

Über Esri

  • Über uns
  • Karriere
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Wir sind an Ihrer Meinung interessiert.
Copyright © 2019 Esri. | Datenschutz | Rechtliches