How to retain domain descriptions from selected features in database to new database?

المشرف العام

Administrator
طاقم الإدارة
I have the following script that selects features from an enterprise database and then exports them to a new database. However, two columns in the database contain domains. How can I keep the descriptions of the domains in the new database that is created rather than the domain numbers?

import arcpyfrom arcpy import envenv.workspace = r'\\path\'stateFeature = r'\\test.shp'parish = arcpy.GetParameterAsText(0)output = arcpy.GetParameterAsText(1)nameField = "PARISH"arcpy.CreateFileGDB_management(output, parish)arcpy.Delete_management('SelectionStateLayer')arcpy.Delete_management('lyr')arcpy.MakeFeatureLayer_management(stateFeature, 'SelectionStateLayer', '"' + str(nameField) + '" = ' + "'" + str(parish) + "'")for fc in arcpy.ListFeatureClasses(): if arcpy.Exists('lyr'): arcpy.Delete_management('lyr') arcpy.MakeFeatureLayer_management(fc, 'lyr') arcpy.SelectLayerByLocation_management('lyr', "INTERSECT", 'SelectionStateLayer') outname = fc.replace(".","_") outpath = output + r'/' + parish + '.gdb' + r'\{0}'.format(outname)) arcpy.CopyFeatures_management('lyr', outpath)arcpy.Delete_management('lyr')

أكثر...
 
أعلى