How to Set a default domain value in a subtype definition using Python

604
2
Jump to solution
11-11-2021 09:04 PM
IanHamilton2
New Contributor III

Hi I have been searching through the help to find a solution for this  but have had no success.

I am using python in Arc Desktop

I am creating a subtype and need to set a default value for domain which is used in a subtype field definition.

for those who have looked in detail there is a tuple of (None, None) where there is no domain on a particular field.

(None, <domainobject>) where there is a domain value but no default value set

how can I set (some value belonging to the domain, <domainobject>)

 

I haven't found a python way of doing this.

Thanks!

0 Kudos
1 Solution

Accepted Solutions
IanHamilton2
New Contributor III

Ah thank you very much.

View solution in original post

0 Kudos
2 Replies
shaylavi
Esri Contributor

Pretty simple -

 

 

arcpy.AssignDefaultToField_management(fc_path, fld_name, def_val, subtype_code)

 

Shay
0 Kudos
IanHamilton2
New Contributor III

Ah thank you very much.

0 Kudos