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, role=None):
"""Removes a role
People and organisations using the role will be untouched. This may
leave some of them without roles.
:param role: The IfcActorRole to remove.
:type role: ifcopenshell.entity_instance.entity_instance
:return: None
:rtype: None
Example::
organisation = ifcopenshell.api.run("owner.add_organisation", model,
identification="AWB", name="Architects Without Ballpens")
role = ifcopenshell.api.run("owner.add_role", model, assigned_object=organisation, role="ARCHITECT")
# After running this, the organisation will have no role again
ifcopenshell.api.run("owner.remove_role", model, role=role)
"""
self.file = file
self.settings = {"role": None}
for key, value in settings.items():
self.settings[key] = value
self.settings = {"role": role}
def execute(self):
for inverse in self.file.get_inverse(self.settings["role"]):