Select to view content in your preferred language

ExportFeatures should create the same output as FeatureClassToFeatureClass

112
0
Thursday
Status: Open
nadja
by
Frequent Contributor

As the title suggests, the two functions should create the same output with the same input and environmental settings. I've got to create a FC with the domain descriptions added as additional fields (efficiently) because I'm going to add the FC to a DB where domains are silently dropped. 

My code:

arcpy.env.transferDomains = True
arcpy.conversion.FeatureClassToFeatureClass(fc, gdb, table_fields)
arcpy.conversion.ExportFeatures(fc, f"{gdb}\\{table_fields}")

 

My result (left from FeatureClassToFeatureClass, right from ExportFeatures): 

fc2fc_exportfc.png

 

 

 

 

 

 

Furthermore, it was nice to choose how the domain description should be added. I'd prefer a suffix to a prefix and to add the new fields just after the field with the domain instead of after all existing fields.

 

Currently the workaround is to use FC2FC, but since this tool is marked as deprecated, who knows how long this workaround still works? being able to transfer domains is an important task and should be easy.