New answers tagged validation
I would write a Python script that checks the model inputs, returning True or False. Then create a script tool for the script. You can drop this tool into your model, as the first node. This basically mimics the validation class of a Python script tool. You can add as many functions and classes as you need, import any module too. Add a script to a model
You could also just build the process in model builder. Then use the model builder option of export model to python scrip. Then load that newly created python script as a python script tool (which you could write validation code for). Maybe not exactly what you were going for, but it's the closest I can think of other than PolyGeo's suggestion of ...
The Understanding validation in script tools page implies that customizing tool validation is only available to Python script tools in regular toolboxes and the tools you write as Python classes in Python (only) toolboxes. It should be possible to write a Python script tool (or a tool in a Python toolbox) that takes parameters, does the validation and then ...
I spoofed up a Python script of 1 parameter and wired it into toolbox and this is how I got it to check a FeatureClass input: import arcpy class ToolValidator(object): """Class for validating a tool's parameter values and controlling the behavior of the tool's dialog.""" def __init__(self): """Setup arcpy and the list of tool parameters.""" ...
Top 50 recent answers are included