mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
Fix #3901. Add configurable list concatenation support in IfcFM.
This commit is contained in:
@@ -125,7 +125,7 @@ class Writer:
|
|||||||
else:
|
else:
|
||||||
self.config = getattr(self.parser.preset, "config")
|
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 = {}
|
self.categories = {}
|
||||||
null = self.config.get("null", null)
|
null = self.config.get("null", null)
|
||||||
empty = self.config.get("empty", empty)
|
empty = self.config.get("empty", empty)
|
||||||
@@ -155,6 +155,8 @@ class Writer:
|
|||||||
value = bool_true
|
value = bool_true
|
||||||
elif value is False:
|
elif value is False:
|
||||||
value = bool_false
|
value = bool_false
|
||||||
|
elif isinstance(value, (list, tuple)):
|
||||||
|
value = list_separator.join([str(v) for v in value])
|
||||||
processed_row.append(value)
|
processed_row.append(value)
|
||||||
rows.append(processed_row)
|
rows.append(processed_row)
|
||||||
|
|
||||||
@@ -261,6 +263,9 @@ class Writer:
|
|||||||
c += 1
|
c += 1
|
||||||
r += 1
|
r += 1
|
||||||
|
|
||||||
|
if "Sheet" in workbook.sheetnames and len(workbook.sheetnames) > 1:
|
||||||
|
workbook.remove(workbook["Sheet"])
|
||||||
|
|
||||||
workbook.save(output)
|
workbook.save(output)
|
||||||
|
|
||||||
def write_pd(self):
|
def write_pd(self):
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ def get_attributes(ifc_file):
|
|||||||
|
|
||||||
|
|
||||||
def get_contact_data(ifc_file, element):
|
def get_contact_data(ifc_file, element):
|
||||||
the_actor = element.Theactor
|
the_actor = element.TheActor
|
||||||
|
|
||||||
if the_actor.is_a("IfcPerson"):
|
if the_actor.is_a("IfcPerson"):
|
||||||
pao = None
|
pao = None
|
||||||
|
|||||||
Reference in New Issue
Block a user