This commit is contained in:
Andrej730
2024-09-03 15:17:17 +05:00
parent bec1d913c5
commit acbdc0ed4c
3 changed files with 34 additions and 14 deletions
@@ -19,7 +19,6 @@
import os
import json
import ifcopenshell.util.schema
from typing import List
cwd = os.path.dirname(os.path.realpath(__file__))
@@ -52,11 +51,19 @@ for schema in mapped_schemas:
type_to_entity_map[schema][element_type] = [e for e in elements if guessed_element in e]
def get_applicable_types(ifc_class: str, schema="IFC4") -> List[str]:
def get_applicable_types(ifc_class: str, schema="IFC4") -> list[str]:
"""Get applicable types IFC classes for the occurrence IFC class.
E.g. "IfcWindow" -> ["IfcWindowType"].
"""
schema = ifcopenshell.util.schema.get_fallback_schema(schema.upper())
return entity_to_type_map[schema].get(ifc_class, [])
def get_applicable_entities(ifc_type_class: str, schema="IFC4") -> List[str]:
def get_applicable_entities(ifc_type_class: str, schema="IFC4") -> list[str]:
"""Get applicable occurrence IFC classes for the type IFC class.
E.g. "IfcWindowType" -> ["IfcWindow"].
"""
schema = ifcopenshell.util.schema.get_fallback_schema(schema.upper())
return type_to_entity_map[schema].get(ifc_type_class, [])