AnsweredAssumed Answered

arcpy.ListSubtypes is not working

Question asked by northpole on May 12, 2013
Latest reply on May 12, 2013 by northpole
Hello,
I am following ESRI Documentation link 'http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000021000000' to print the details of subtype associated with a feature class but for some reason am always getting an error message complaining arcpy doesn't contain a definition for ListSubtypes(table_name) method.

Here is the code snippet,
          subtypes = arcpy.ListSubtypes(table_name)           for stcode, stdict in subtypes.iteritems():             print('Code: {0}'.format(stcode))             for stkey in stdict.iterkeys():                 if stkey == 'FieldValues':                     print('Fields:')                     fields = stdict[stkey]                     for field, fieldvals in fields.iteritems():                                         print(' --Field name: {0}'.format(field))                         print(' --Field default value: {0}'.format(fieldvals[0]))                         if not fieldvals[1] is None:                             print(' --Domain name: {0}'.format(fieldvals[1].name))                 else:                                         print('{0}: {1}'.format(stkey, stdict[stkey]))


Here is the error message,

[HTML]PYTHON ERRORS:
Error Info:
'module' object has no attribute 'ListSubtypes'
Exception Type is: <type 'exceptions.AttributeError'>
Traceback info:
  File "\\machine_name\published_folder\GPT\listAllDataObjFieldsNamesTypes.py", line 72, in <module>
    subtypes = arcpy.ListSubtypes(schemaObject)
[/HTML]

Secondly, I was wondering if there is anyway we can get a subtype values instead of codes. I know I can use a search cursor to get the distinct values from a featureclass for the subtype field but that won't give me the actual values associated with these codes. Kindly share your thought on it.

I am using ArcGIS Desktop 10.1 with ArcSDE 10 (64bit Oracle 11g).

In advance I thank you all for your time and support.

Outcomes