ifcopenshell.api.owner.update_owner_history#

Module Contents#

class ifcopenshell.api.owner.update_owner_history.Usecase(file, element=None)#

Updates the owner that is assigned to an object

This ensures that the owner is tracked to have modified the object last, including the time when the change occured. See ifcopenshell.api.owner.create_owner_history for details.

Parameters

element (ifcopenshell.entity_instance.entity_instance) – The IfcRoot element to update the ownership details on when a change is made.

Returns

The updated IfcOwnerHistory element.

Return type

ifcopenshell.entity_instance.entity_instance

Example:

# See ifcopenshell.api.owner.create_owner_history for setup
# [ ... example setup code ... ]

# We've finished our ownership setup. Now let's start our script and
# create a space. Notice we don't actually call
# create_owner_history at all. This is already automatically handled
# by the API when necessary. Under the hood, the API is actually
# running this code on the IfcSpace element:
# element.OwnerHistory = ifcopenshell.api.run("owner.create_owner_history", model)
space = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcSpace")

# Any edits we make will have ownership tracking automatically
# applied. There is no need to run any owner.update_owner_history
# API calls either.
ifcopenshell.api.run("attribute.edit_attributes", model, product=space, attributes={"Name": "Lobby"})
execute(self)#