ifcopenshell.api.drawing.unassign_product#

Module Contents#

class ifcopenshell.api.drawing.unassign_product.Usecase(file, relating_product=None, related_object=None)#

Unassigns a product and an object (typically an annotation)

Smart annotation objects can be associated with products so that they can annotate attributes and properties. This function lets you remove the association, so that you may change the assocation with another object later or leave the annotation as a “dumb” annotation.

Parameters
Returns

The created IfcRelAssignsToProduct relationship

Return type

ifcopenshell.entity_instance.entity_instance

Example:

furniture = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcFurniture")
annotation = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcAnnotation")
ifcopenshell.api.run("drawing.assign_product", model,
    relating_product=furniture, related_object=annotation)

# Let's change our mind and remove the relationship
ifcopenshell.api.run("drawing.unassign_product", model,
    relating_product=furniture, related_object=annotation)
execute(self)#