diff --git a/src/ifcopenshell-python/ifcopenshell/api/project/create_file.py b/src/ifcopenshell-python/ifcopenshell/api/project/create_file.py index a353db9d51..bc0bb23ef5 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/project/create_file.py +++ b/src/ifcopenshell-python/ifcopenshell/api/project/create_file.py @@ -3,12 +3,17 @@ import ifcopenshell class Usecase: - def __init__(self, **settings): - self.settings = {"version": "IFC4"} - for key, value in settings.items(): - self.settings[key] = value + def __init__(self, foobar: ifcopenshell.entity_instance, version: str = "IFC4", foo: str = None, bar: int = 1, baz: float = 0.5): + """Create File - def execute(self): + Create a new IFC file object + + :param version: The schema version of the IFC file. Choose from "IFC2X3" or "IFC4". + :return: file: The created IFC file object. + """ + self.settings = {"version": version} + + def execute(self) -> ifcopenshell.file: self.file = ifcopenshell.file(schema=self.settings["version"]) # TODO: add all metadata, pending bug #747 self.file.wrapped_data.header.file_name.name = "/dev/null" # Hehehe @@ -22,5 +27,5 @@ class Usecase: self.file.wrapped_data.header.file_name.preprocessor_version = "IfcOpenShell {}".format(ifcopenshell.version) self.file.wrapped_data.header.file_name.originating_system = "IfcOpenShell {}".format(ifcopenshell.version) self.file.wrapped_data.header.file_name.authorization = "Nobody" - self.file.wrapped_data.header.file_description.description = ('ViewDefinition[DesignTransferView]',) + self.file.wrapped_data.header.file_description.description = ("ViewDefinition[DesignTransferView]",) return self.file