mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +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 = ifccsv.IfcCsv()
|
||||||
ifc_csv.output = self.filepath
|
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)
|
ifc_csv.Import(context.scene.CsvProperties.csv_ifc_file)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class IfcCsv:
|
|||||||
self.attributes = []
|
self.attributes = []
|
||||||
self.output = ""
|
self.output = ""
|
||||||
self.selector = None
|
self.selector = None
|
||||||
self.delimiter = ";"
|
self.delimiter = ","
|
||||||
|
|
||||||
def export(self, ifc_file, elements):
|
def export(self, ifc_file, elements):
|
||||||
self.ifc_file = ifc_file
|
self.ifc_file = ifc_file
|
||||||
@@ -112,7 +112,7 @@ class IfcCsv:
|
|||||||
self.results.append(result)
|
self.results.append(result)
|
||||||
|
|
||||||
with open(self.output, "w", newline="", encoding="utf-8") as f:
|
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 = ["GlobalId"]
|
||||||
header.extend(self.attributes)
|
header.extend(self.attributes)
|
||||||
writer.writerow(header)
|
writer.writerow(header)
|
||||||
|
|||||||
Reference in New Issue
Block a user