Write docs for owner API module

This commit is contained in:
Dion Moult
2022-12-14 15:58:31 +11:00
parent 05cd11ae12
commit a5a1ef2e8e
24 changed files with 696 additions and 103 deletions
@@ -18,11 +18,28 @@
class Usecase:
def __init__(self, file, **settings):
def __init__(self, file, address=None):
"""Removes an address
Naturally, any organisations or people using that address will have the
relationship removed.
:param address: The IfcAddress to remove.
:type address: ifcopenshell.entity_instance.entity_instance
:return: None
:rtype: None
Example::
organisation = ifcopenshell.api.run("owner.add_organisation", model)
address = ifcopenshell.api.run("owner.add_address", model,
assigned_object=organisation, ifc_class="IfcPostalAddress")
# Change our mind and delete it
ifcopenshell.api.run("owner.remove_address", model, address=address)
"""
self.file = file
self.settings = {"address": None}
for key, value in settings.items():
self.settings[key] = value
self.settings = {"address": address}
def execute(self):
for inverse in self.file.get_inverse(self.settings["address"]):