This content has been marked as final. Show 7 replies
I can wrap that up into an exists function.
Long after the fact, but this thread very nearly answers my question...
I want to make a conditional statement happen if a domain doesn't yet exist. In other words, if the domain "GOES_TO" does not exist, I don't want it be (unsuccessfully) created in the next step.
desc = arcpy.Describe(gdb_path)
domains = desc.domains
for domain in domains:
if domain == "GOES_TO":
isitthere = "yes"
isitthere = "no"
if isitthere == "no":
#create the new domain, etc.
This code doesn't work because as the list goes through each domain, all of them but one are not called "GOES_TO", which means that isitthere will always equal "no". But at least you can see what I'm trying to do... I feel like there's something obvious that I'm missing...
isthere = False for domain in domains: if domain == "GOES_TO": isthere = True break if not isthere: # do something
yes, that is what I was missing. I appreciate the quick answer. Thanks!
Yeah, I found that out in another thread. I'm using 10.0 though, so I'll have to wait for an upgrade to use ListDomain.