Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b8df655fa4 | |||
| 86ac9a2b91 | |||
| af39a52f42 |
@@ -1,7 +1,7 @@
|
||||
from typing import Any
|
||||
|
||||
from ifcopenshell.entity_instance import entity_instance
|
||||
from ifcopenshell.util.element import get_type
|
||||
from ifcopenshell.util.element import get_psets, get_type
|
||||
|
||||
|
||||
def extract_properties(element: entity_instance) -> dict[str, object]:
|
||||
@@ -10,6 +10,11 @@ def extract_properties(element: entity_instance) -> dict[str, object]:
|
||||
"Property Sets": _get_ifc_object_properties(element),
|
||||
}
|
||||
|
||||
# Add quantities if they exist
|
||||
quantities = _get_quantities(element)
|
||||
if quantities:
|
||||
properties["Quantities"] = quantities
|
||||
|
||||
if (ifc_type := get_type(element)) is not None:
|
||||
properties["Element Type Property Sets"] = _get_ifc_element_type_properties(
|
||||
ifc_type,
|
||||
@@ -90,3 +95,11 @@ def _get_properties(properties: entity_instance) -> dict[str, Any]:
|
||||
# elif prop.is_a("IfcPropertyTableValue"):
|
||||
# properties[name] = #not sure if we want to support these...
|
||||
return result
|
||||
|
||||
|
||||
def _get_quantities(element: entity_instance) -> dict[str, object]:
|
||||
"""
|
||||
Extract quantity takeoffs (QTOs) from an IFC element.
|
||||
"""
|
||||
quantities = get_psets(element, qtos_only=True)
|
||||
return quantities if quantities else {}
|
||||
|
||||
Reference in New Issue
Block a user