ifcopenshell.api.cost.add_cost_item

Module Contents

ifcopenshell.api.cost.add_cost_item.add_cost_item(file, cost_schedule=None, cost_item=None) None

Add a new cost item

A cost item represents a single line item in a cost schedule. Cost items may then be broken down into cost subitems.

Parameters:
  • cost_schedule (ifcopenshell.entity_instance) – If the cost item is to be added as a root or top level cost item to a cost schedule, the IfcCostSchedule may be specified. This is mutually exlclusive to the cost_item parameter.

  • cost_item (ifcopenshell.entity_instance) – If the cost item is to be added as a subitem to an existing cost item, the parent IfcCostItem may be specified. This is mutually exclusive to the cost_schedule parameter.

Returns:

The newly created IfcCostItem

Return type:

ifcopenshell.entity_instance

Example:

# The very first cost item must be in a cost schedule
schedule = ifcopenshell.api.run("cost.add_cost_schedule", model)

# You may add cost items as top level item in the schedule
item1 = ifcopenshell.api.run("cost.add_cost_item", model, cost_schedule=schedule)

# Alternatively you may add them as subitems
item2 = ifcopenshell.api.run("cost.add_cost_item", model, cost_item=item1)