ifcopenshell.api.owner.add_role#

Module Contents#

class ifcopenshell.api.owner.add_role.Usecase(file, assigned_object=None, role='ARCHITECT')#

Adds and assigns a new role

People and organisations must play one or more roles on a project. Roles include architects, engineers, subcontractors, clients, manufacturers, etc. Typically these roles and their corresponding responsibilities will be outlined in contractual documents.

This function will both add and assign the role to the person or organisation.

Parameters
  • assigned_object (ifcopenshell.entity_instance.entity_instance) – The IfcPerson or IfcOrganization the role should be assigned to.

  • role (str, optional) – The type of role, taken from the IFC documentation for IfcActorRole, or a custom name.

Returns

The newly created IfcActorRole

Return type

ifcopenshell.entity_instance.entity_instance

Example:

organisation = ifcopenshell.api.run("owner.add_organisation", model,
    identification="AWB", name="Architects Without Ballpens")
ifcopenshell.api.run("owner.add_role", model, assigned_object=organisation, role="ARCHITECT")
execute(self)#