I try to convert CSV point data to DXF CAD data. CSV file has about 270,000 points. I searched this issue and it is because ArcGIS is 32bit, and Background Processing Tool 64bit software is required to enable 64bit processing for Python. But unfortunately I have Background Processing Tool for ArcGIS 10.5, my ArcGIS version is 10.5.1. From forums, another solution is seperating csv data and then using "APPEND_TO_EXISTING_FILES" in ExportCAD_conversion tool, so I assigned csv data to a Pandas dataframe, I chunked it to 5 dataframes and I converted 5 dataframes to csv. And I used the export tool within a function:
def export_DXF(csv_path):
dxf_folder = "..\\Outputs\\DXF"
dxf_path = "..\\Outputs\\DXF\\switch.DXF"
gdb_path = "output_data.gdb"
point_feature_class_dir = "\\switch"
point_feature_class = "switch"
if not os.path.exists(dxf_folder):
os.makedirs(dxf_folder)
spatial_ref = arcpy.Describe(get_input() + '\ELE_DD_SEPARATOR_POINT').spatialReference
featureclass_path = 'output_data.gdb\\switch'
directory_gdb = os.getcwd()
print("Koordinat sistemi: ", spatial_ref.Name)
if arcpy.Exists(gdb_path):
arcpy.Delete_management(gdb_path)
print ("gdb path has been deleted.")
arcpy.CreateFileGDB_management(directory_gdb, gdb_path)
if arcpy.Exists(featureclass_path):
arcpy.Delete_management(featureclass_path)
arcpy.MakeXYEventLayer_management(csv_path, 'Point_X', 'Point_Y', featureclass_path, spatial_ref, '#')
arcpy.FeatureClassToFeatureClass_conversion(featureclass_path, gdb_path, point_feature_class)
print ("CSV tablosundan Feature Class olusturma islemi tamamlandi.")
arcpy.ExportCAD_conversion(gdb_path + point_feature_class_dir, 'DXF_R2013', dxf_path,
'Ignore_Filenames_in_Tables', 'APPEND_TO_EXISTING_FILES', '#')
dosya_sil(csv_path)
dosya_sil(dxf_path + ".xml")
print "dxf dosya donusumu tamamlandi."
in a function within for loop:
a=0
path_array = [switch1.csv, switch2.csv, switch3.csv, switch4.csv, switch5.csv]
for i in path_array:
a = a + 1
csv_path=("..\\Outputs\\" + i)
export_DXF(csv_path,a)
However, when I run the script, first it creates one DXF and file size is 90MB, in second loop it appends second DXF, the file size is 180MB and then it waits for a long time without any output. Is there any solution exporting huge CSV file to DXF?