Fixed version of f3f7939c8b + get_element_zones

This commit is contained in:
Andrej730
2025-03-11 12:06:25 +05:00
parent ed0b1c5009
commit 64f51d733e
4 changed files with 26 additions and 9 deletions
@@ -66,13 +66,24 @@ def get_system_elements(system: ifcopenshell.entity_instance) -> list[ifcopenshe
def get_element_systems(element: ifcopenshell.entity_instance) -> list[ifcopenshell.entity_instance]:
results = []
for rel in element.HasAssignments:
if rel.is_a("IfcRelAssignsToGroup") and rel.RelatingGroup.is_a() in (
"IfcSystem",
"IfcDistributionSystem",
"IfcBuildingSystem",
"IfcZone",
):
results.append(rel.RelatingGroup)
if rel.is_a("IfcRelAssignsToGroup"):
continue
group = rel.RelatingGroup
if not group.is_a("IfcSystem") or group.is_a() in ("IfcStructuralAnalysisModel", "IfcZone"):
continue
results.append(group)
return results
def get_element_zones(element: ifcopenshell.entity_instance) -> list[ifcopenshell.entity_instance]:
results = []
for rel in element.HasAssignments:
if rel.is_a("IfcRelAssignsToGroup"):
continue
group = rel.RelatingGroup
if not group.is_a("IfcZone"):
continue
results.append(group)
return results