AddIDMessage method |
|
|
Release 9.3
Last modified January 19, 2010 |
Print all topics in : "Properties and Methods" |
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
| Part | Description |
| object | The instantiated geoprocessing object. |
| MessageType | Keyword MessageType defines whether the message will be an error or a warning. Valid MessageTypes are
|
| 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. |
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)