ifcopenshell.api.resource.edit_resource_quantity

Module Contents

ifcopenshell.api.resource.edit_resource_quantity.edit_resource_quantity(file: ifcopenshell.file, physical_quantity: ifcopenshell.entity_instance, attributes: dict[str, Any]) None

Edits the attributes of an IFC quantity

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

Parameters:
  • physical_quantity (ifcopenshell.entity_instance) – The IfC quantity 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 time used in hours
ifcopenshell.api.resource.edit_resource_quantity(model,
    physical_quantity=time, attributes={"TimeValue": 8.0})