AnsweredAssumed Answered

creating and populating domains in python, short vs longs

Question asked by gisbert61 on Oct 27, 2014
Latest reply on Oct 28, 2014 by gisbert61

I want to use about ten domains each having between 10-100 coded values. The values may change over time as I receive feedback on the validity. Typing them by hand is not a feasible option

 

I created CSV's using Excel with the following format:

 

1;Snake

2;Fish

3;Mammal

4;Critter

and so on

 

Using

 

arcpy.CreateDomain_management(WorkSpace, "D_all", "all", "LONG", "CODED", "DEFAULT", "DEFAULT")

 

I can create a domain which I can populate using

 

arcpy.TableToDomain_management(all_csv, "Field1", "Field2", WorkSpace, "D_all", "all", "REPLACE")

 

So far, so good. But I don't seem to be able to use this domain in my featureclass properties/subtypes unless I use a 'SHORT' instead of a 'LONG'. Unfortunately when I create the domain using a 'SHORT' I get an error when using the TableToDomain function (error 000307)

 

does anyone has any idea on how to either populate the domain using a 'SHORT' as the coded value or how to get it working in my featureclass properties/subtypes?

 

regards,

 

Bert

 

By the way, how can I mark code as 'code' in this editor??

Outcomes