mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
typing
This commit is contained in:
@@ -65,22 +65,22 @@ def update_name(self: "BIMContainer", context: bpy.types.Context) -> None:
|
||||
tool.Ifc.get_object(tool.Ifc.get().by_id(ifc_definition_id)).name = self.name
|
||||
|
||||
|
||||
def update_active_container_index(self, context):
|
||||
def update_active_container_index(self: "BIMSpatialDecompositionProperties", context: bpy.types.Context) -> None:
|
||||
SpatialDecompositionData.data["subelement_class"] = SpatialDecompositionData.subelement_class()
|
||||
if tool.Blender.get_enum_safe(self, "subelement_class") is None:
|
||||
self.subelement_class = SpatialDecompositionData.data["subelement_class"][0][0]
|
||||
tool.Spatial.load_contained_elements()
|
||||
|
||||
|
||||
def update_should_include_children(self, context):
|
||||
def update_should_include_children(self: "BIMSpatialDecompositionProperties", context: bpy.types.Context) -> None:
|
||||
tool.Spatial.load_contained_elements()
|
||||
|
||||
|
||||
def update_element_mode(self, context):
|
||||
def update_element_mode(self: "BIMSpatialDecompositionProperties", context: bpy.types.Context) -> None:
|
||||
tool.Spatial.load_contained_elements()
|
||||
|
||||
|
||||
def update_container_obj(self, context):
|
||||
def update_container_obj(self: "BIMObjectSpatialProperties", context: bpy.types.Context) -> None:
|
||||
if self.container_obj is None or not (obj := context.active_object):
|
||||
return
|
||||
if not (element := tool.Ifc.get_entity(self.container_obj)):
|
||||
|
||||
@@ -169,7 +169,7 @@ class Usecase:
|
||||
self.target_class = "IfcPresentationStyle"
|
||||
return self.append_presentation_style()
|
||||
|
||||
def get_existing_element(self, element):
|
||||
def get_existing_element(self, element: ifcopenshell.entity_instance) -> Union[ifcopenshell.entity_instance, None]:
|
||||
if element.id() in self.added_elements:
|
||||
return self.added_elements[element.id()]
|
||||
try:
|
||||
@@ -180,7 +180,7 @@ class Usecase:
|
||||
elif element.is_a("IfcProfileDef"):
|
||||
return [e for e in self.file.by_type("IfcProfileDef") if e.ProfileName == element.ProfileName][0]
|
||||
except:
|
||||
return False
|
||||
return None
|
||||
|
||||
def append_material(self):
|
||||
self.whitelisted_inverse_attributes = {
|
||||
|
||||
Reference in New Issue
Block a user