ifcopenshell.api.resource.add_resource

Module Contents

ifcopenshell.api.resource.add_resource.add_resource(file, parent_resource=None, ifc_class='IfcCrewResource', name=None, predefined_type='NOTDEFINED') None

Add a new construction resource

Construction resources may be managed and connected to cost schedules and construction schedules. This allows calculations to be done on resource utilisation, cost optimisation (e.g. labour rates), and optioneering on build strategies.

There are typically two types of resources. Crew resources are resources where you manage your own crew and you have full control over the equipment, labour, products, and materials used by your crew. Alternatively, there are subcontractor resources, where you simply delegate all the details to a subcontractor and it is not decomposed into further levels of detail.

This means when adding resources, you’d first either add a crew or subcontract resource. If it is a crew resource, you’d then add child resources to that crew, such as equipment (cranes, excavators, hoists, etc), material (wood, concrete, etc), and labour (rigging crews, formworkers, etc).

Parameters:
  • parent_resource (ifcopenshell.entity_instance) – If this is a child resource (typically to a crew resource), then nominate the parent IfcConstructionResource here.

  • ifc_class (str,optional) – The class of resource chosen from IfcConstructionEquipmentResource, IfcConstructionMaterialResource, IfcConstructionProductResource, IfcCrewResource, IfcLaborResource, or IfcSubContractResource.

  • name (str,optional) – The name of the resource

  • predefined_type (str,optional) – Consult the IFC documentation for the valid predefined types for each type of resource class.

Returns:

The newly created resource depending on the nominated IFC class.

Return type:

ifcopenshell.entity_instance

Example:

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

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