ifcopenshell.api.owner.add_role

Module Contents

ifcopenshell.api.owner.add_role.add_role(file: ifcopenshell.file, assigned_object: ifcopenshell.entity_instance, role: str = 'ARCHITECT') ifcopenshell.entity_instance

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) – 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. Defaults to “ARCHITECT”.

Returns:

The newly created IfcActorRole

Return type:

ifcopenshell.entity_instance

Example:

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