Fix #4286. IfcCSV summaries are now formatted the same as the rows.

This commit is contained in:
Dion Moult
2024-03-30 15:40:02 +11:00
parent ed79cbb1cc
commit 02058efa4d
+8 -2
View File
@@ -240,13 +240,19 @@ class IfcCsv:
index = attributes.index(data["name"])
formatting_indices[index] = data["format"]
for row in self.results:
for index, format_query in formatting_indices.items():
for index, format_query in formatting_indices.items():
for row in self.results:
if row[index] == null:
continue
row[index] = '"' + str(row[index]).replace('"', '\\"') + '"'
row[index] = ifcopenshell.util.selector.format(format_query.replace("{{value}}", row[index]))
if self.summaries[index] is not None:
summary_label, summary_value = self.summaries[index].split(": ")
summary_value = '"' + str(summary_value).replace('"', '\\"') + '"'
summary_value = ifcopenshell.util.selector.format(format_query.replace("{{value}}", summary_value))
self.summaries[index] = summary_label + ": " + str(summary_value)
def sort_results(self, sort, attributes, include_global_id):
if not self.results:
return