Is there a way to delay validation of tool parameters?

133
2
Jump to solution
06-11-2012 02:44 PM
PaulSimpson
New Contributor III
Hi everyone.  I am new to these forums, new to ModelBuilder, and pretty new to ArcGIS as well.  I am an experienced programmer, including object oriented languages, so for the most part I am able to psych out the ArcGIS tools for use in ModelBuilder.  Here is a problem which has eluded me.

My model includes this section:

[ATTACH=CONFIG]15117[/ATTACH]

The Natural Neighbor tool requires a Z Value Field as input.  Unfortunately the model doesn???t know what fields are available until the Project tool has run.   When I run within ModelBuilder there is no problem, since the model doesn???t check the validity of the Z Value Field entry until it is ready to run Natural Neighbor, by which time the projected feature class exists to validate it.  When run as a tool, the model checks the validity of the Natural Neighbor Z Value Field value up front, before the Project tool has run, so the model fails to run.  Is there a way when running a model as a tool to delay validation of tool parameters such as this Z Value Field until the specific tool is ready to run?

Thanks

Paul
0 Kudos
1 Solution

Accepted Solutions
NobbirAhmed
Esri Regular Contributor
May not be possible in ModelBuilder. You need to chain the same sequence of tools in a Python script and use that script in a script tool. Script tool has tool validator class through which you can control validation. If you want to do so, start here:

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Customizing_script_tool_behavior/00150...

To get started with creating script tools, start here:

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/A_quick_tour_of_creating_script_tools/...

View solution in original post

0 Kudos
2 Replies
NobbirAhmed
Esri Regular Contributor
May not be possible in ModelBuilder. You need to chain the same sequence of tools in a Python script and use that script in a script tool. Script tool has tool validator class through which you can control validation. If you want to do so, start here:

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Customizing_script_tool_behavior/00150...

To get started with creating script tools, start here:

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/A_quick_tour_of_creating_script_tools/...

View solution in original post

0 Kudos
PaulSimpson
New Contributor III
Thanks.  I guess it was time to get in to python anyway.  P.
0 Kudos