Skip to content

Instantly share code, notes, and snippets.

@M-Bryant
Created April 19, 2016 01:58
Show Gist options
  • Save M-Bryant/70f01d8ff2b6219b3323637916215b34 to your computer and use it in GitHub Desktop.
Save M-Bryant/70f01d8ff2b6219b3323637916215b34 to your computer and use it in GitHub Desktop.
arcpy: Query domains
domains = arcpy.da.ListDomains(r'C:\temp\test.gdb')
for domain in domains:
print(u'\nDomain name: {0}'.format(domain.name))
if domain.domainType == 'CodedValue':
coded_values = domain.codedValues
for val, desc in coded_values.iteritems():
print(u'\t{0} : {1}'.format(val, desc))
elif domain.domainType == 'Range':
print(u'\tMin: {0}'.format(domain.range[0]))
print(u'\tMax: {0}'.format(domain.range[1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment