ifcopenshell.api.classification.remove_reference

Module Contents

ifcopenshell.api.classification.remove_reference.remove_reference(file: ifcopenshell.file, reference: ifcopenshell.entity_instance, products: list[ifcopenshell.entity_instance]) None

Removes a classification reference from the list of products

If the classification reference is no longer associated to any products, the classification reference itself is also removed.

Parameters:
  • reference (ifcopenshell.entity_instance) – The IfcClassificationReference entity of the relationship you want to remove.

  • product (list[ifcopenshell.entity_instance]) – The list fo object entities of the relationship you want to remove.

Raises:

TypeError – If file is IFC2X3 and products has non-IfcRoot elements.

Returns:

None

Return type:

None

Example:

wall_type = model.by_type("IfcWallType")[0]
classification = ifcopenshell.api.classification.add_classification(
    model, classification="MyCustomClassification")
reference = ifcopenshell.api.classification.add_reference(model,
    products=[wall_type], classification=classification,
    identification="W_01", name="Interior Walls")
ifcopenshell.api.classification.remove_reference(model,
    reference=reference, products=[wall_type])