ifcopenshell.api.resource.edit_resource_time

Module Contents

class ifcopenshell.api.resource.edit_resource_time.Usecase
execute()
get_resource()
ifcopenshell.api.resource.edit_resource_time.edit_resource_time(file: ifcopenshell.file, resource_time: ifcopenshell.entity_instance, attributes: dict[str, Any]) None

Edits the attributes of an IfcResourceTime

For more information about the attributes and data types of an IfcResourceTime, consult the IFC documentation.

Parameters:
  • resource_time (ifcopenshell.entity_instance) – The IfcResourceTime entity you want to edit

  • attributes (dict) – a dictionary of attribute names and values.

Returns:

None

Return type:

None

Example:

# Add our own crew
crew = ifcopenshell.api.resource.add_resource(model, ifc_class="IfcCrewResource")

# Add some labour to our crew.
labour = ifcopenshell.api.resource.add_resource(model,
    parent_resource=crew, ifc_class="IfcLaborResource")

# Labour resource is quantified in terms of time.
ifcopenshell.api.resource.add_resource_quantity(model,
    resource=labour, ifc_class="IfcQuantityTime")

# Store the unit time used in hours
ifcopenshell.api.resource.edit_resource_quantity(model,
    physical_quantity=time, attributes={"TimeValue": 8.0})

# Let's imagine we've used the resource for 2 days.
time = ifcopenshell.api.resource.add_resource_time(model, resource=labour)
ifcopenshell.api.resource.edit_resource_time(model,
    resource_time=time, attributes={"ScheduleWork": "P16H"})