Show Navigation | Hide Navigation
You are here:
Geoprocessing > Automating your work with scripts > Scripting object: Properties and Methods > Properties and Methods

AddIDMessage method

Release 9.3
Last modified January 19, 2010
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Properties and Methods"


Related Topics

Note: This topic was updated for 9.3.1.

Allows you to use system messages with a script tool

NOTE: Supported only when the geoprocessor is instantiated using the arcgisscripting module; not supported when using the win32com module. Learn more about creating the geoprocessor object



Syntax


object.AddIDMessage(MessageType as String, messageID As String, {AddArgument1}, {AddArgument2})

Part Description
object The instantiated geoprocessing object.
MessageType Keyword MessageType defines whether the message will be an error or a warning. Valid MessageTypes are
  • Error
  • Warning
MessageID The message ID allows you to reference existing messages for your scripting errors and warnings.
A list of IDs that can be used are provided under Understanding geoprocessing tool errors and warnings.
AddArgument1 Optional. Depending on which message ID is used, an argument may be necessary to complete the message.
Common examples include dataset or field names.
AddArgument2 Optional. Depending on which message ID is used, an argument may be necessary to complete the message.
Common examples include dataset or field names.


Examples



import arcgisscripting
import sys
gp = arcgisscripting.create(9.3)

inFeatureClass = gp.GetParameterAsText(0)
outFeatureClass =  gp.GetParameterAsText(1)

try:
    # If the output feature class already exists, raise an error
    #
    if gp.Exists(inFeatureClass):
        raise "OverWriteError"
    else:
        #
        # Additional processing steps
        #

except "OverwriteError":
    # Use message ID 12, and provide the output feature class
    #    to complete the message.
    #
    gp.AddIDMessage("Error", 12, outFeatureClass)



Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.