feat: attach attributes that are on the element type level (#9)

* Added better property extraction

* property sets naming

* Get attributes from element type
This commit is contained in:
Jedd Morgan
2025-07-15 10:26:35 +01:00
committed by GitHub
parent 308e1bb59d
commit 2e351b4254
2 changed files with 6 additions and 2 deletions
+1
View File
@@ -102,6 +102,7 @@ def open_and_convert_file(
model_id=model_id,
project_id=project_id,
message=version_message,
source_application="IFC",
)
version = client.version.create(create_version)
end = time.time()
+5 -2
View File
@@ -6,7 +6,7 @@ from ifcopenshell.util.element import get_type
def extract_properties(element: entity_instance) -> dict[str, object]:
properties: dict[str, object] = {
"Attributes": get_attributes(element),
"Attributes": _get_attributes(element),
"Property Sets": _get_ifc_object_properties(element),
}
@@ -14,11 +14,14 @@ def extract_properties(element: entity_instance) -> dict[str, object]:
properties["Element Type Property Sets"] = _get_ifc_element_type_properties(
ifc_type,
)
properties["Element Type Attributes"] = _get_attributes(
ifc_type,
)
return properties
def get_attributes(element: entity_instance) -> dict[str, object]:
def _get_attributes(element: entity_instance) -> dict[str, object]:
return element.get_info(True, False, scalar_only=True)