agomezl

GPStringHidden not working in python toolbox

Discussion created by agomezl on Jun 30, 2014
Latest reply on Jul 8, 2014 by khibma-esristaff
Helloo Forum

I'm testing the GPStringHidden datatype in a 10.2.0  python toolbox.
Just a simply test: creating a GPStringHidden parameter and showing with arcpy.AddMessage the string the user entered when running the python toolbox tool

My parameters info section looks like this:


p0 = arcpy.Parameter(
displayName="Testing a hidden string",
name="strhid1",
datatype="GPStringHidden",
parameterType="Required",
direction="Input")


params = [p0]
return params


And my execute section just like tthis

arcpy.AddMessage(parameters[0].value)



And it seems that the datatype is not recognized, because I get the error:


Traceback (most recent call last):
  File "<string>", line 30, in getParameterInfo
  File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\arcobjects\mixins.py", line 286, in __init__
    setattr(self, attrib, attribvalue)
  File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\arcobjects\_base.py", line 89, in _set
    return setattr(self._arc_object, attr_name, cval(val))
ValueError: ParameterObject: Invalid input value for DataType property


Has anybody experienced the same?

Thanks in advanced

Antonio

Outcomes