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:
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.run("classification.add_classification",
    model, classification="MyCustomClassification")
reference = ifcopenshell.api.run("classification.add_reference", model,
    products=[wall_type], classification=classification,
    identification="W_01", name="Interior Walls")
ifcopenshell.api.run("classification.remove_reference", model,
    reference=reference, products=[wall_type])