-
Notifications
You must be signed in to change notification settings - Fork 0
/
validation.py
34 lines (28 loc) · 1.15 KB
/
validation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class ToolValidator:
# Class to add custom behavior and properties to the tool and tool parameters.
def __init__(self):
# set self.params for use in other function
self.params = arcpy.GetParameterInfo()
def updateMessages(self):
# Customize messages for the parameters.
# This gets called after standard validation.
shapetype = arcpy.Describe(self.params[5]).shapeType.lower()
if shapetype == "polygon" or shapetype == "line":
self.params[5].setErrorMessage("Should be a point shapefile.")
return
def initializeParameters(self):
# Customize parameter properties.
# This gets called when the tool is opened.
return
def updateParameters(self):
# Modify parameter values and properties.
# This gets called each time a parameter is modified, before
# standard validation.
return
# def isLicensed(self):
# # set tool isLicensed.
# return True
# def postExecute(self):
# # This method takes place after outputs are processed and
# # added to the display.
# return