npssde

Python script tools - are conditional output parameters possible?

Discussion created by npssde on Mar 28, 2011
Latest reply on Mar 30, 2011 by ethoms
Hello,

I've tried a couple of approaches to setting script tool output params conditionally.  I have a script with input booleans that control whether a set of tables and raster datasets get created.  I'd like to have the script behind the tool control which output params get added to the map document upon completion. 

It seems like output params have to be declared in the Properties --> Parameters tab when setting up a script tool.   So, can these output params be controlled conditionally from the script behind the tool?  I don't need validation, just something like calling gp.SetParameterAsText() conditionally without errors getting thrown.  I've gotten it to the point of not throwing errors, but it also refuses to add the output param to the map.   

Insights appreciated!

Lisa

Outcomes