Default value of field not accessible via arcpy?

1505
2
Jump to solution
06-23-2014 11:56 AM
KerryAlley
Occasional Contributor
The Python/arcpy field class does not have a defaultValue property!  Is that an oversight, or a deliberate feature of arcpy's field class?  I know the IField interface (ArcObjects) will provide the defaultValue, but using comtypes is a hassle.  Any other way of getting the default field value using Python?

Thanks,
Kerry
Tags (2)
1 Solution

Accepted Solutions
BradPosthumus
Occasional Contributor II
It appears they added defaultValue into arcpy in version 10.1, so I assume you're using an earlier version?

View solution in original post

2 Replies
BradPosthumus
Occasional Contributor II
It appears they added defaultValue into arcpy in version 10.1, so I assume you're using an earlier version?
KerryAlley
Occasional Contributor
Aaaargh!  You're right!  The field.defaultValue *is* a valid property...it just isn't documented in 10.1 or 10.2!!!

I was relying on the documentation for the arcpy field class.  I also tried searching the 10.2 help for "defaultValue," and finally gave up and parsed the default values out of the metadata xml files (ugh!).

I submitted feedback through the Help pages, so hopefully that will be updated.

Kerry