ifcopenshell.api.pset.unassign_pset

Module Contents

ifcopenshell.api.pset.unassign_pset.unassign_pset(file: ifcopenshell.file, products: list[ifcopenshell.entity_instance], pset: ifcopenshell.entity_instance) None

Unassign property set from the provided elements.

Parameters:
  • products – Elements (or element types) to assign the pset from.

  • pset – Property set.

Example:

element1 = ifcopenshell.api.root.create_entity(self.file, ifc_class="IfcWall")
element2 = ifcopenshell.api.root.create_entity(self.file, ifc_class="IfcWall")
ifcopenshell.api.pset.assign_pset(self.file, [element1, element2], pset)

# Pset is now shared by 2 elements.
assert ifcopenshell.util.element.get_elements_by_pset(pset) == {element1, element2}

ifcopenshell.api.pset.unassign_pset(self.file, [element2], pset)
# Pset was unassigned from element2.
assert ifcopenshell.util.element.get_elements_by_pset(pset) == {element1}