mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 19:52:36 +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
|
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()
|
SpatialDecompositionData.data["subelement_class"] = SpatialDecompositionData.subelement_class()
|
||||||
if tool.Blender.get_enum_safe(self, "subelement_class") is None:
|
if tool.Blender.get_enum_safe(self, "subelement_class") is None:
|
||||||
self.subelement_class = SpatialDecompositionData.data["subelement_class"][0][0]
|
self.subelement_class = SpatialDecompositionData.data["subelement_class"][0][0]
|
||||||
tool.Spatial.load_contained_elements()
|
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()
|
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()
|
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):
|
if self.container_obj is None or not (obj := context.active_object):
|
||||||
return
|
return
|
||||||
if not (element := tool.Ifc.get_entity(self.container_obj)):
|
if not (element := tool.Ifc.get_entity(self.container_obj)):
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ class Usecase:
|
|||||||
self.target_class = "IfcPresentationStyle"
|
self.target_class = "IfcPresentationStyle"
|
||||||
return self.append_presentation_style()
|
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:
|
if element.id() in self.added_elements:
|
||||||
return self.added_elements[element.id()]
|
return self.added_elements[element.id()]
|
||||||
try:
|
try:
|
||||||
@@ -180,7 +180,7 @@ class Usecase:
|
|||||||
elif element.is_a("IfcProfileDef"):
|
elif element.is_a("IfcProfileDef"):
|
||||||
return [e for e in self.file.by_type("IfcProfileDef") if e.ProfileName == element.ProfileName][0]
|
return [e for e in self.file.by_type("IfcProfileDef") if e.ProfileName == element.ProfileName][0]
|
||||||
except:
|
except:
|
||||||
return False
|
return None
|
||||||
|
|
||||||
def append_material(self):
|
def append_material(self):
|
||||||
self.whitelisted_inverse_attributes = {
|
self.whitelisted_inverse_attributes = {
|
||||||
|
|||||||
Reference in New Issue
Block a user