Skip to content

Commit

Permalink
Fixed errors displaying IFC Connections for IfcRelConnectsElements
Browse files Browse the repository at this point in the history
IfcRelConnectsElements type of connection wasn't handled properly resulting in errors.
Now you should be able to see connections for connected slabs, walls etc - https://i.imgur.com/LpFBKBC.png

Traceback:
Traceback (most recent call last):
  File "\blenderbim\bim\module\geometry\ui.py", line 102, in draw
    ConnectionsData.load()
  File "\blenderbim\bim\module\geometry\data.py", line 100, in load
    cls.data = {"connections": cls.connections()}
  File "\blenderbim\bim\module\geometry\data.py", line 134, in connections
    relating_element_connection_type = rel.RelatingConnectionType
  File "\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 171, in __getattr__
    raise AttributeError(
AttributeError: entity instance of type 'IFC4.IfcRelConnectsElements' has no attribute 'RelatingConnectionType'
  • Loading branch information
Andrej730 committed Jul 3, 2023
1 parent a980ce1 commit 7b92057
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/blenderbim/blenderbim/bim/module/geometry/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,13 @@ def connections(cls):
for rel in connected_to:
if element.is_a("IfcDistributionPort"):
related_element = rel.RelatedPort
related_element_connection_type = ""
else:
related_element = rel.RelatedElement

if element.is_a("IfcRelConnectsPathElements"):
related_element_connection_type = rel.RelatedConnectionType
else:
related_element_connection_type = ""

results.append(
{
Expand All @@ -128,10 +131,13 @@ def connections(cls):
for rel in connected_from:
if element.is_a("IfcDistributionPort"):
relating_element = rel.RelatingPort
relating_element_connection_type = ""
else:
relating_element = rel.RelatingElement

if element.is_a("IfcRelConnectsPathElements"):
relating_element_connection_type = rel.RelatingConnectionType
else:
relating_element_connection_type = ""

results.append(
{
Expand Down

0 comments on commit 7b92057

Please sign in to comment.