import arcgisscripting
gp = arcgisscripting.create(9.3)
ws = "c:\\temp\\test.gdb"
desc = gp.describe(ws)
print "Domains in '%s': " % ws
domains = desc.Domains
for domain in domains:
print domain
gp.DomainToTable(ws, domain, ws + "\\domain_" + domain , "CODE", "DESCRIPTION")
To run the script:
- Open up a Python Editor, such as PyScripter or PythonWin
- Copy the above code to a script file
- Make sure there is a tab before the print domain, and gp.DomainToTable(... lines (it doesn't seemed to include tabs properly in the blog posts).
- Update the ws variable to the GeoDatabase you wish to analyse
- Click run
Notes:
- The output tables are named "domain_XXX" where XXX is the name of the domain
- Each of these tables have two fields: one called CODE, which lists the code and a second called DESCRIPTION which lists the description.