Created
April 19, 2016 01:58
-
-
Save M-Bryant/70f01d8ff2b6219b3323637916215b34 to your computer and use it in GitHub Desktop.
arcpy: Query domains
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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