mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
New documentation for project create_file usecase
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user