mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Fix #3901. Add configurable list concatenation support in IfcFM.
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user