maarten.hofman

boolean variables in toolbox: how are they passed to a python script?

Discussion created by maarten.hofman on Feb 7, 2012
Latest reply on Feb 8, 2012 by maarten.hofman
Hi,

Q: how and in what form are boolean variables passed from a toolbox to its python script?

I have a python script that works fine when I use 'True' (text string) as an argument in PythonWin, but when I tick the checkbox in the ArcGIS toolbox, it doesn't seem to work... (script behaves as if it has received a 'False')

I use arcpy.GetParamterAsText(), assuming that even if the argument gets passed as a boolean from the toolbox, it would still be converted to text string. But if it does, shouldn't it be resulting in the same 'True' text string? That doesn't happen, judging from the different behaviour of the script. Or would it be the value 1 that gets passed as a '1' text string?

Any thoughts?

Maarten

Outcomes