Fix bug where IFCCSV delimiter was not able to be specified on read/write properly

This commit is contained in:
Dion Moult
2021-03-22 15:35:17 +11:00
parent 32769184b0
commit 92d28901ac
2 changed files with 6 additions and 2 deletions
@@ -80,6 +80,10 @@ class ImportIfcCsv(bpy.types.Operator):
ifc_csv = ifccsv.IfcCsv()
ifc_csv.output = self.filepath
if props.csv_delimiter == "CUSTOM":
ifc_csv.delimiter = props.csv_custom_delimiter
else:
ifc_csv.delimiter = props.csv_delimiter
ifc_csv.Import(context.scene.CsvProperties.csv_ifc_file)
return {"FINISHED"}
+2 -2
View File
@@ -91,7 +91,7 @@ class IfcCsv:
self.attributes = []
self.output = ""
self.selector = None
self.delimiter = ";"
self.delimiter = ","
def export(self, ifc_file, elements):
self.ifc_file = ifc_file
@@ -112,7 +112,7 @@ class IfcCsv:
self.results.append(result)
with open(self.output, "w", newline="", encoding="utf-8") as f:
writer = csv.writer(f)
writer = csv.writer(f, delimiter=self.delimiter)
header = ["GlobalId"]
header.extend(self.attributes)
writer.writerow(header)