ifcopenshell.api.cost.edit_cost_value_formula

Module Contents

class ifcopenshell.api.cost.edit_cost_value_formula.Usecase
edit_cost_value(data, parent=None)
execute()
ifcopenshell.api.cost.edit_cost_value_formula.edit_cost_value_formula(file: ifcopenshell.file, cost_value: ifcopenshell.entity_instance, formula: str) None

Sets a cost value based on a formula, similar to formulas in spreadsheets

Costs may be made up of many components (e.g. labour, material, waste factor, taxes, etc). This can be easily represented in the form of a formula similar thta would be used in spreadsheet applications.

For more information, see ifcopenshell.util.cost

Parameters:
  • cost_value (ifcopenshell.entity_instance) – The IfcCostValue to set the values of

  • formula (str) – The formula following the language of ifcopenshell.util.cost

Returns:

None

Return type:

None

Example:

schedule = ifcopenshell.api.cost.add_cost_schedule(model)
item = ifcopenshell.api.cost.add_cost_item(model, cost_schedule=schedule)

value = ifcopenshell.api.cost.add_cost_value(model, parent=item)
ifcopenshell.api.cost.edit_cost_value_formula(model, cost_value=value,
    formula="5000 * 1.19")