Display subtypes and their descriptions for a feature class

I posted this gist earlier today to check the subtypes that are available in a given feature class.

import arcpy
ftr = r"C://Some//Arb//Folder//work.gdb//ftr"
subs = arcpy.da.ListSubtypes(ftr)
for k, v in subs.iteritems():
print k, v['Name']

It’s quite self-explanatory, so I posted it as-is, as a useful code snippet. The subtype codes are returned as keys in the dictionary, while the values are themselves dictionaries containing all the properties of the subtype.

I’m only interested in the description of the subtype, which is why I am printing out the value in the values dictionary at the key ‘Name’. Full description of the function capabilities is here.

On an unrelated note, I can’t get used to the new structure of the online help.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.