hjelmsmark

Python Toolbox DataTypes

Discussion created by hjelmsmark on Oct 19, 2012
Latest reply on Oct 19, 2012 by JScheirer-esristaff
If i look at my tool description in ArcCatalog all parameters are listed as String datatypes even though thy're set to Booleans, Long etc. Why?
Problem is, that ModelBuilder also think they're Strings.

       def getParameterInfo(self):
        # String
        param_1 = arcpy.Parameter()
        param_1.name = u'MyStringInput'
        param_1.displayName = u'MyStringInput'
        param_1.parameterType = 'Required'
        param_1.direction = 'Input'
        param_1.dataType = u'String'

        # Long
        param_2 = arcpy.Parameter()
        param_2.name = u'MyIntInput'
        param_2.displayName = u'MyIntInput'
        param_2.parameterType = 'Optional'
        param_2.direction = 'Input'
        param_2.dataType = u'Long'

        # Bool
        param_3 = arcpy.Parameter()
        param_3.name = u'MyBoolInput'
        param_3.displayName = u'MyBoolInput'
        param_3.parameterType = 'Optional'
        param_3.direction = 'Input'
        param_3.dataType = u'Boolean'

        # Result
        param_4 = arcpy.Parameter()
        param_4.name = u'ResultOutput'
        param_4.displayName = u'ResultOutput'
        param_4.parameterType = 'Derived'
        param_4.direction = 'Output'
        param_4.dataType = u'String'


[ATTACH=CONFIG]18574[/ATTACH]

Attachments

Outcomes