Update: 10/10/2014
My issue with the Describe() class has been cleared up by adding the .value extension in my updateParameters() method:
def updateParameters(self, parameters):
describe = arcpy.Describe(parameters[0].value)
However, now when I attempt to use the setWarningMessage() function, I get no response from ArcMap. My updateParameters() consists of the following:
def updateParameters(self, parameters):
describe = arcpy.Describe(parameters[0].value)
#check = str(describe.shapeType)
if describe.shapeType == 'Point':
parameters[0].setWarningMessage('This is a point feature class')
else:
parameters[0].clearMessage()
if parameters[2].value == True:
parameters[3].enabled = True
parameters[4].enabled = True
parameters[5].enabled = True
else:
parameters[3].enabled = False
parameters[4].enabled = False
parameters[5].enabled = False
return
When I add a shapefile that I know in fact is a point, the tool does not output a warning. It simply accepts it without any feedback to the user. Does it matter if the Describe.shapeType function has an output of Unicode? I tested this through the ArcMap Python window with the following sequence of commands:
However, even if I try to convert the Describe.shapeType to a string, I still don't get a warning message. I've done the following tests:
- Rather than checking for: if describe.shapeType == 'Point', I tried to check for: if describe.shapeType == u'Point', which would force it to check for a Unicode data type.
- Converting the shapeType into a string via str(decribe.shapeType).
- Using the encode method to change the Unicode into a sequence of ASCII characters: describe.shapeType.encode('ascii', 'ignore').
Hence, I've hit a wall once again. Any assistance on this would be appreciated.