Setting field defaults/domains based on subtypes

المشرف العام

Administrator
طاقم الإدارة
I have a rather complicated FeatureClass, in which one of the fields has a different default value, and a different domain, depending on the value in the nominated SubType field.

Using the rather useful code in this example, I get this output: (trimmed to just the field in question, for length)

Code: 1 Default: True Name: EducationalFacility SubtypeField: FCSUBTYPE Fields: --Field name: FACILITYTYPE --Field default value: 3 --Domain name: dEducationalFacilityType Code: 2 Default: False Name: HospitalFacility SubtypeField: FCSUBTYPE Fields: --Field name: FACILITYTYPE --Field default value: 6 --Domain name: dHospitalFacilityType Code: 3 Default: False Name: CommunityFacility SubtypeField: FCSUBTYPE Fields: --Field name: FACILITYTYPE --Field default value: 3 --Domain name: dCommunityFacilityType Note the different domains for each subtype value. The FACILITYTYPE field itself has no domain set.

When I copy this FeatureClass, using FeatureClassToFeatureClass with arcpy.env.transferDomains = True, I lose all this interesting subtype information. I can recreate the domains for fields that have domains set directly, but I can't work out how to transfer this domain-within-a-subtype stuff with arcpy.



أكثر...
 
أعلى