MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / write

Method write

src/ifc5d/ifc5d/ifc5Dspreadsheet.py:540–555  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

538
539class Ifc5DXlsxWriter(Ifc5Dwriter):
540 def write(self) -> None:
541 import xlsxwriter
542
543 super().write()
544 os.makedirs(self.output, exist_ok=True)
545 file_name = ""
546 for cost_schedule in self.cost_schedules:
547 if file_name:
548 file_name += "_" + cost_schedule.Name or ""
549 else:
550 file_name += cost_schedule.Name or ""
551 self.file_path = os.path.join(self.output, "{}.xlsx".format(file_name))
552 self.workbook = xlsxwriter.Workbook(self.file_path)
553 for cost_schedule in self.cost_schedules:
554 self.write_table(cost_schedule)
555 self.workbook.close()
556
557 def write_table(self, cost_schedule):
558 worksheet = self.workbook.add_worksheet(self.sheet_data[cost_schedule.id()]["Name"])

Callers 2

test_export_xlsx_odsMethod · 0.95
export_cost_schedulesMethod · 0.95

Calls 5

write_tableMethod · 0.95
formatMethod · 0.80
writeMethod · 0.45
joinMethod · 0.45
closeMethod · 0.45

Tested by 1

test_export_xlsx_odsMethod · 0.76