mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
14 lines
595 B
Python
14 lines
595 B
Python
class Usecase:
|
|
def __init__(self, file, **settings):
|
|
self.file = file
|
|
self.settings = {"assigned_object": None, "ifc_class": "IfcPostalAddress"}
|
|
for key, value in settings.items():
|
|
self.settings[key] = value
|
|
|
|
def execute(self):
|
|
address = self.file.create_entity(self.settings["ifc_class"], "OFFICE")
|
|
addresses = list(self.settings["assigned_object"].Addresses) if self.settings["assigned_object"].Addresses else []
|
|
addresses.append(address)
|
|
self.settings["assigned_object"].Addresses = addresses
|
|
return address
|