From 64b8842055f6437156c10d9753e490422942a44c Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 27 Mar 2025 10:36:43 +0500 Subject: [PATCH] typing --- src/bonsai/bonsai/bim/module/spatial/prop.py | 10 ++++------ .../ifcopenshell/api/root/create_entity.py | 4 ---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/spatial/prop.py b/src/bonsai/bonsai/bim/module/spatial/prop.py index 910bb2e28c..4041821366 100644 --- a/src/bonsai/bonsai/bim/module/spatial/prop.py +++ b/src/bonsai/bonsai/bim/module/spatial/prop.py @@ -268,14 +268,12 @@ class BIMSpatialDecompositionProperties(PropertyGroup): should_include_children: bool @property - def active_container(self): - if self.containers and self.active_container_index < len(self.containers): - return self.containers[self.active_container_index] + def active_container(self) -> Union[BIMContainer, None]: + return tool.Blender.get_active_uilist_element(self.containers, self.active_container_index) @property - def active_element(self): - if self.elements and self.active_element_index < len(self.elements): - return self.elements[self.active_element_index] + def active_element(self) -> Union[Element, None]: + return tool.Blender.get_active_uilist_element(self.elements, self.active_element_index) class BIMGridProperties(PropertyGroup): diff --git a/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py b/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py index ad44cede8d..96a3b130be 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py +++ b/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py @@ -43,15 +43,11 @@ def create_entity( operation type but many people forget. :param ifc_class: Any rooted IFC class. - :type ifc_class: str,optional :param predefined_type: Any built-in or user-defined predefined type that is applicable to that IFC class. For user-defined predefined types just enter in any value and the API will handle it automatically. - :type predefined_type: str,optional :param name: The name of the new element. - :type name: str,optional :return: The newly created element based on the specified IFC class. - :rtype: ifcopenshell.entity_instance Example: