mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
New utility to get IFC all elements that are relevant in Brickschema
This commit is contained in:
@@ -17,4 +17,16 @@ def get_brick_type(element):
|
||||
result = ifc4_to_brick_map.get(f"{element.is_a()}.{predefined_type}", None)
|
||||
if not result:
|
||||
result = ifc4_to_brick_map.get(element.is_a(), None)
|
||||
return result
|
||||
if result:
|
||||
return f"https://brickschema.org/schema/Brick#{result}"
|
||||
|
||||
|
||||
def get_brick_elements(ifc_file):
|
||||
classes = {c.split(".")[0] for c in ifc4_to_brick_map.keys()}
|
||||
elements = []
|
||||
for ifc_class in classes:
|
||||
try:
|
||||
elements += ifc_file.by_type(ifc_class)
|
||||
except:
|
||||
pass
|
||||
return elements
|
||||
|
||||
Reference in New Issue
Block a user