ifcopenshell.api.cost.add_cost_item

Module Contents

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

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.

Either cost_schedule or cost_item must be provided.

Parameters:
  • cost_schedule (ifcopenshell.entity_instance, optional.) – 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, optional) – 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.cost.add_cost_schedule(model)

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

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