import arcpy subtypes = arcpy.da.ListSubtypes('C:/data/Boston.gdb/Boundary') for stcode, stdict in subtypes.iteritems(): print('Code: {0}'.format(stcode)) for stkey in stdict.iterkeys(): if stkey == 'FieldValues': print('Fields:') fields = stdict[stkey] for field, fieldvals in fields.iteritems(): print(' --Field name: {0}'.format(field)) print(' --Field default value: {0}'.format(fieldvals[0])) if not fieldvals[1] is None: print(' --Domain name: {0}'.format(fieldvals[1].name)) else: print('{0}: {1}'.format(stkey, stdict[stkey]))
'C:/data/Boston.gdb/Boundary'
r'C:\data\Boston.gdb\Boundary'
'C:\\data\\Boston.gdb\\Boundary'
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.