G'day all, please read https://community.osarch.org/discussion/comment/29745/#Comment_29745 regarding a schedule to migrate forum software. Aiming to fully migrate on 15-16 Aug.
IfcDiff in Bonsai with Property enabled results in error
I am trying to run IfcDiff in Bonsai. When I am trying to include comparison of properties, I am getting errors.
I am attaching my sample old and new file. I am able to reproduce with various files.
This is my IfcDiff settings:

When running it, I get this error:
Python: Traceback (most recent call last):
File "/home/pol/.config/blender/5.1/extensions/.local/lib/python3.13/site-packages/bonsai/bim/module/diff/operator.py", line 165, in execute
ifc_diff.export(self.filepath)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/home/pol/.config/blender/5.1/extensions/.local/lib/python3.13/site-packages/ifcdiff.py", line 266, in export
json.dump(
~~~~~~~~~^
{
^
...<6 lines>...
default=self.json_dump_default,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/pol/software/blender-5.1.0-linux-x64/5.1/python/lib/python3.13/json/__init__.py", line 179, in dump
for chunk in iterable:
^^^^^^^^
File "/home/pol/software/blender-5.1.0-linux-x64/5.1/python/lib/python3.13/json/encoder.py", line 433, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "/home/pol/software/blender-5.1.0-linux-x64/5.1/python/lib/python3.13/json/encoder.py", line 407, in _iterencode_dict
yield from chunks
File "/home/pol/software/blender-5.1.0-linux-x64/5.1/python/lib/python3.13/json/encoder.py", line 407, in _iterencode_dict
yield from chunks
File "/home/pol/software/blender-5.1.0-linux-x64/5.1/python/lib/python3.13/json/encoder.py", line 407, in _iterencode_dict
yield from chunks
[Previous line repeated 1 more time]
File "/home/pol/software/blender-5.1.0-linux-x64/5.1/python/lib/python3.13/json/encoder.py", line 440, in _iterencode
o = _default(o)
File "/home/pol/.config/blender/5.1/extensions/.local/lib/python3.13/site-packages/ifcdiff.py", line 262, in json_dump_default
return json.JSONEncoder.default(None, obj)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/home/pol/software/blender-5.1.0-linux-x64/5.1/python/lib/python3.13/json/encoder.py", line 180, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
f'is not JSON serializable')
TypeError: Object of type SetOrdered is not JSON serializable
I get the same result with Bonsai 0.8.5 and with 0.8.6alpha.
Am I doing something wrong or is this a bug? I would like to compare my two files including changes in properties.
Tom
Tagged:

Comments
Definitely a bug, please report :)
Thanks for the confirmation, I reported the issue: https://github.com/IfcOpenShell/IfcOpenShell/issues/8905