Your code doesn't do anything related to colours, so not sure what to say about your code.
However test3.ifc correctly has a blue colour. In the version released on the Blender extensions store, it may show up as grey, and that's just a temporary regression while we switch to v0.8. It's already been fixed but we haven't yet released a version with the fix I think. Blue is the correct colour, the other two IFC viewers have a bug.
Ok, thank you, @Moult
So that bug in the other software seems to only exist for Beams/Columns (Extrusions?)
So if I Tessellated the Beam, it should show correctly? Unfortunately I don't manage to
Note: API not available due to missing dependencies: geometry.add_representation - No module named 'bpy'
Note: API not available due to missing dependencies: grid.create_axis_curve - No module named 'bpy'
Traceback (most recent call last):
File "/Users/smr/opt/anaconda3/envs/structural/lib/python3.10/site-packages/ifcopenshell/entity_instance.py", line 352, in __setitem__
self.method_list[idx](self.wrapped_data, idx, entity_instance.unwrap_value(value))
File "/Users/smr/opt/anaconda3/envs/structural/lib/python3.10/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 6570, in setArgumentAsAggregateOfInt
return _ifcopenshell_wrapper.entity_instance_setArgumentAsAggregateOfInt(self, i, v)
TypeError: Attribute of type AGGREGATE OF INTEGER needs a python sequence of ints
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/smr/Desktop/test2.py", line 15, in <module>
output = ifcpatch.execute({
File "/Users/smr/opt/anaconda3/envs/structural/lib/python3.10/site-packages/ifcpatch/__init__.py", line 84, in execute
patcher.patch()
File "/Users/smr/opt/anaconda3/envs/structural/lib/python3.10/site-packages/ifcpatch/recipes/TessellateElements.py", line 115, in patch
mesh = ifcopenshell.api.run(
File "/Users/smr/opt/anaconda3/envs/structural/lib/python3.10/site-packages/ifcopenshell/api/__init__.py", line 92, in run
return usecase_function(ifc_file, should_run_listeners=should_run_listeners, **settings)
File "/Users/smr/opt/anaconda3/envs/structural/lib/python3.10/site-packages/ifcopenshell/api/__init__.py", line 258, in wrapper
raise e
File "/Users/smr/opt/anaconda3/envs/structural/lib/python3.10/site-packages/ifcopenshell/api/__init__.py", line 252, in wrapper
result = usecase(*args, **settings)
File "/Users/smr/opt/anaconda3/envs/structural/lib/python3.10/site-packages/ifcopenshell/api/geometry/add_mesh_representation.py", line 59, in add_mesh_representation
return usecase.execute()
File "/Users/smr/opt/anaconda3/envs/structural/lib/python3.10/site-packages/ifcopenshell/api/geometry/add_mesh_representation.py", line 66, in execute
return self.create_mesh_representation()
File "/Users/smr/opt/anaconda3/envs/structural/lib/python3.10/site-packages/ifcopenshell/api/geometry/add_mesh_representation.py", line 71, in create_mesh_representation
return self.create_polygonal_face_set()
File "/Users/smr/opt/anaconda3/envs/structural/lib/python3.10/site-packages/ifcopenshell/api/geometry/add_mesh_representation.py", line 96, in create_polygonal_face_set
faces = [self.file.createIfcIndexedPolygonalFace([v + 1 for v in f]) for f in self.settings["faces"][i]]
File "/Users/smr/opt/anaconda3/envs/structural/lib/python3.10/site-packages/ifcopenshell/api/geometry/add_mesh_representation.py", line 96, in <listcomp>
faces = [self.file.createIfcIndexedPolygonalFace([v + 1 for v in f]) for f in self.settings["faces"][i]]
File "/Users/smr/opt/anaconda3/envs/structural/lib/python3.10/site-packages/ifcopenshell/file.py", line 379, in create_entity
e[idx] = arg
File "/Users/smr/opt/anaconda3/envs/structural/lib/python3.10/site-packages/ifcopenshell/entity_instance.py", line 354, in __setitem__
raise TypeError(
TypeError: attribute 'CoordIndex' for entity 'IFC4.IfcIndexedPolygonalFace' is expecting value of type 'AGGREGATE OF INT', got 'list'.
Comments
Are you sure that's the same file? It looks grey to me.
@Moult you are correct. I've tried to replicate my problem in a simple way. Let me try again:
I'm creating a IfcBeamType with the following code:
When I'm opening it with BlenderBIM 0.0.240602 the colour is correct.
When I'm opening it with Bonsai 0.0.240815 the colour is grey.
With other Viewers it's as above.
What am I doing wrong?
Your code doesn't do anything related to colours, so not sure what to say about your code.
However test3.ifc correctly has a blue colour. In the version released on the Blender extensions store, it may show up as grey, and that's just a temporary regression while we switch to v0.8. It's already been fixed but we haven't yet released a version with the fix I think. Blue is the correct colour, the other two IFC viewers have a bug.
Ok, thank you, @Moult
So that bug in the other software seems to only exist for Beams/Columns (Extrusions?)
So if I Tessellated the Beam, it should show correctly? Unfortunately I don't manage to
gives the following error: