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, resource_time=None, attributes=None) 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, optional) – a dictionary of attribute names and values.

Returns:

None

Return type:

None

Example:

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

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

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

# Store the unit time used in hours
ifcopenshell.api.run("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.run("resource.add_resource_time", model, resource=labour)
ifcopenshell.api.run("resource.edit_resource_time", model,
    resource_time=time, attributes={"ScheduleWork": "P16H"})