Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# @author Cindy Jayakumar
# @date 21/07/2018
# Extract domains from a field in one feature class, and apply
# it to matching fields in another feature class.
import arcpy
source_fc = r'C:\Some\Arb\Folder\test.gdb\source'
target_fc = r'C:\Some\Arb\Folder\test.gdb\target'
# Get field names and domains if applicable
source_fields = { : field.domain for field in arcpy.ListFields(source_fc) if field.domain}
for field in arcpy.ListFields(target_fc):
if in source_fields and field.domain is None:,, source_fields[])
print("Assigned {0} to {1}".format(source_fields[],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.