ifcopenshell.api.library.unassign_reference

Module Contents

ifcopenshell.api.library.unassign_reference.unassign_reference(file: ifcopenshell.file, reference: ifcopenshell.entity_instance, products: list[ifcopenshell.entity_instance]) None

Unassigns a product of products from a reference

If the product isn’t assigned to the reference, nothing will happen.

Parameters:
Returns:

None

Return type:

None

Example:

library = ifcopenshell.api.run("library.add_library", model, name="Brickschema")

# Let's create a reference to a single AHU in our Brickschema dataset
reference = ifcopenshell.api.run("library.add_reference", model, library=library)
ifcopenshell.api.run("library.edit_reference", model,
    reference=reference, attributes={"Identification": "http://example.org/digitaltwin#AHU01"})

# Let's assume we have an AHU in our model.
ahu = ifcopenshell.api.run("root.create_entity", model,
    ifc_class="IfcUnitaryEquipment", predefined_type="AIRHANDLER")

# And now assign the IFC model's AHU with its Brickschema counterpart
ifcopenshell.api.run("library.assign_reference", model, reference=reference, products=[ahu])

# Let's change our mind and unassign it.
ifcopenshell.api.run("library.unassign_reference", model, reference=reference, products=[ahu])