From c85826ef2e70bea238fc8d616d0aa6a0d8f4399a Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 18 Oct 2023 16:40:07 +0500 Subject: [PATCH] Fixed #3901 It was throwing an error because was failing to write a list to an excel cell, now it's explicitly converting the value to string. Python: Traceback (most recent call last): File "\blenderbim\bim\module\fm\operator.py", line 102, in execute writer.write_xlsx(filepath) File "\blenderbim\libs\site\packages\ifcfm\__init__.py", line 259, in write_xlsx cell = worksheet.cell(row=r, column=c, value=col) File "\blenderbim\libs\site\packages\openpyxl\worksheet\worksheet.py", line 247, in cell cell.value = value File "\blenderbim\libs\site\packages\openpyxl\cell\cell.py", line 218, in value self._bind_value(value) File "\blenderbim\libs\site\packages\openpyxl\cell\cell.py", line 187, in _bind_value raise ValueError("Cannot convert {0!r} to Excel".format(value)) ValueError: Cannot convert ['USE TYPE CATALOG'] to Excel --- src/ifcfm/ifcfm/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcfm/ifcfm/__init__.py b/src/ifcfm/ifcfm/__init__.py index 36f6679145..70f31c8ef6 100644 --- a/src/ifcfm/ifcfm/__init__.py +++ b/src/ifcfm/ifcfm/__init__.py @@ -256,7 +256,7 @@ class Writer: cell_format = "n" else: cell_format = colours[c - 1] # Adjusted the indexing - cell = worksheet.cell(row=r, column=c, value=col) + cell = worksheet.cell(row=r, column=c, value=str(col)) cell.fill = cell_formats[cell_format] c += 1 r += 1