mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 03:05:33 +00:00
Added small UI to show realizing elements for the connections
Example - https://i.imgur.com/JLDcnbK.png
This commit is contained in:
@@ -114,7 +114,13 @@ class ConnectionsData:
|
|||||||
else:
|
else:
|
||||||
related_element = rel.RelatedElement
|
related_element = rel.RelatedElement
|
||||||
|
|
||||||
if element.is_a("IfcRelConnectsPathElements"):
|
realizing_elements = []
|
||||||
|
realizing_elements_connection_type = ""
|
||||||
|
if rel.is_a("IfcRelConnectsWithRealizingElements"):
|
||||||
|
realizing_elements.extend(rel.RealizingElements)
|
||||||
|
realizing_elements_connection_type = rel.ConnectionType
|
||||||
|
|
||||||
|
if rel.is_a("IfcRelConnectsPathElements"):
|
||||||
related_element_connection_type = rel.RelatedConnectionType
|
related_element_connection_type = rel.RelatedConnectionType
|
||||||
else:
|
else:
|
||||||
related_element_connection_type = ""
|
related_element_connection_type = ""
|
||||||
@@ -125,6 +131,8 @@ class ConnectionsData:
|
|||||||
"is_relating": True,
|
"is_relating": True,
|
||||||
"Name": related_element.Name or "Unnamed",
|
"Name": related_element.Name or "Unnamed",
|
||||||
"ConnectionType": related_element_connection_type,
|
"ConnectionType": related_element_connection_type,
|
||||||
|
"realizing_elements": realizing_elements,
|
||||||
|
"realizing_elements_connection_type": realizing_elements_connection_type
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -134,7 +142,13 @@ class ConnectionsData:
|
|||||||
else:
|
else:
|
||||||
relating_element = rel.RelatingElement
|
relating_element = rel.RelatingElement
|
||||||
|
|
||||||
if element.is_a("IfcRelConnectsPathElements"):
|
realizing_elements = []
|
||||||
|
realizing_elements_connection_type = ""
|
||||||
|
if rel.is_a("IfcRelConnectsWithRealizingElements"):
|
||||||
|
realizing_elements.extend(rel.RealizingElements)
|
||||||
|
realizing_elements_connection_type = rel.ConnectionType
|
||||||
|
|
||||||
|
if rel.is_a("IfcRelConnectsPathElements"):
|
||||||
relating_element_connection_type = rel.RelatingConnectionType
|
relating_element_connection_type = rel.RelatingConnectionType
|
||||||
else:
|
else:
|
||||||
relating_element_connection_type = ""
|
relating_element_connection_type = ""
|
||||||
@@ -145,6 +159,8 @@ class ConnectionsData:
|
|||||||
"is_relating": False,
|
"is_relating": False,
|
||||||
"Name": relating_element.Name or "Unnamed",
|
"Name": relating_element.Name or "Unnamed",
|
||||||
"ConnectionType": relating_element_connection_type,
|
"ConnectionType": relating_element_connection_type,
|
||||||
|
"realizing_elements": realizing_elements,
|
||||||
|
"realizing_elements_connection_type": realizing_elements_connection_type
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -146,6 +146,20 @@ class BIM_PT_connections(Panel):
|
|||||||
op = row.operator("bim.remove_connection", icon="X", text="")
|
op = row.operator("bim.remove_connection", icon="X", text="")
|
||||||
op.connection = connection["id"]
|
op.connection = connection["id"]
|
||||||
|
|
||||||
|
if connection["realizing_elements"]:
|
||||||
|
row = self.layout.row(align=True)
|
||||||
|
connection_type = connection["realizing_elements_connection_type"]
|
||||||
|
connection_type = f" ({connection_type})" if connection_type else ""
|
||||||
|
row.label(text=f"Realizing elements{connection_type}:")
|
||||||
|
|
||||||
|
for element in connection["realizing_elements"]:
|
||||||
|
row = self.layout.row(align=True)
|
||||||
|
obj = tool.Ifc.get_object(element)
|
||||||
|
row.label(text=obj.name)
|
||||||
|
row.operator(
|
||||||
|
"bim.select_entity", text="", icon="RESTRICT_SELECT_OFF"
|
||||||
|
).ifc_id = element.id()
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_mesh(Panel):
|
class BIM_PT_mesh(Panel):
|
||||||
bl_label = "Representation Utilities"
|
bl_label = "Representation Utilities"
|
||||||
|
|||||||
Reference in New Issue
Block a user