diff --git a/src/blenderbim/blenderbim/bim/import_ifc.py b/src/blenderbim/blenderbim/bim/import_ifc.py index 4697f297a2..e97ec9ed94 100644 --- a/src/blenderbim/blenderbim/bim/import_ifc.py +++ b/src/blenderbim/blenderbim/bim/import_ifc.py @@ -1308,7 +1308,11 @@ class IfcImporter: ): return representation.Items[0].MappingTarget - def create_curve(self, element: ifcopenshell.entity_instance, shape) -> bpy.types.Curve: + def create_curve( + self, + element: ifcopenshell.entity_instance, + shape: Union[ifcopenshell.geom.ShapeElementType, ifcopenshell.geom.ShapeType], + ) -> bpy.types.Curve: if hasattr(shape, "geometry"): geometry = shape.geometry else: diff --git a/src/blenderbim/blenderbim/bim/ui.py b/src/blenderbim/blenderbim/bim/ui.py index 6cdb0cc332..e276164b58 100644 --- a/src/blenderbim/blenderbim/bim/ui.py +++ b/src/blenderbim/blenderbim/bim/ui.py @@ -35,15 +35,22 @@ import blenderbim.bim import blenderbim.tool as tool from blenderbim.bim.helper import IfcHeaderExtractor from blenderbim.bim.prop import Attribute +from typing import Optional class IFCFileSelector: - def is_existing_ifc_file(self, filepath=None): + filepath: str + + def is_existing_ifc_file(self, filepath: Optional[str] = None) -> bool: + """Check if file path exists and if it's an IFC file. + + If `filepath` is not provided, will use filepath property from the current operator. + """ if filepath is None: filepath = self.filepath return os.path.exists(filepath) and "ifc" in os.path.splitext(filepath)[1].lower() - def get_filepath(self): + def get_filepath(self) -> str: """get filepath taking into account relative paths""" if self.use_relative_path: filepath = os.path.relpath(self.filepath, bpy.path.abspath("//"))