mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Fix bug where IFCCSV delimiter was not able to be specified on read/write properly
This commit is contained in:
@@ -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"}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user