Last active
August 29, 2015 14:17
-
-
Save cindygis/dad9bfc8f5f115519a74 to your computer and use it in GitHub Desktop.
Prints out a list of code-value pairs for a given attribute domain in a workspace.
This file contains 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
import arcpy | |
arcpy.env.workspace = "Database Connections\arb.sde" | |
cvd = "cvd_District" | |
for dom in arcpy.da.ListDomains(): | |
if dom.name == cvd: | |
for i in dom.codedValues.iteritems(): | |
print i | |
# One liner | |
cvd_pairs = [i for i in dom.codedValues.iteritems() for dom in arcpy.da.ListDomains() if dom.name == cvd] | |
for cv in cvd_pairs: print cv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment