Fix #3901. Add configurable list concatenation support in IfcFM.

This commit is contained in:
Dion Moult
2023-10-20 13:38:17 +11:00
parent eff68dda38
commit c5e5f4ab6a
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -125,7 +125,7 @@ class Writer:
else:
self.config = getattr(self.parser.preset, "config")
def write(self, null="N/A", empty="-", bool_true="YES", bool_false="NO"):
def write(self, null="N/A", empty="-", bool_true="YES", bool_false="NO", list_separator=", "):
self.categories = {}
null = self.config.get("null", null)
empty = self.config.get("empty", empty)
@@ -155,6 +155,8 @@ class Writer:
value = bool_true
elif value is False:
value = bool_false
elif isinstance(value, (list, tuple)):
value = list_separator.join([str(v) for v in value])
processed_row.append(value)
rows.append(processed_row)
@@ -261,6 +263,9 @@ class Writer:
c += 1
r += 1
if "Sheet" in workbook.sheetnames and len(workbook.sheetnames) > 1:
workbook.remove(workbook["Sheet"])
workbook.save(output)
def write_pd(self):
+1 -1
View File
@@ -248,7 +248,7 @@ def get_attributes(ifc_file):
def get_contact_data(ifc_file, element):
the_actor = element.Theactor
the_actor = element.TheActor
if the_actor.is_a("IfcPerson"):
pao = None