ifcopenshell.api.group.assign_group

Module Contents

ifcopenshell.api.group.assign_group.assign_group(file: ifcopenshell.file, products: list[ifcopenshell.entity_instance], group: ifcopenshell.entity_instance) ifcopenshell.entity_instance | None

Assigns products to a group

If a product is already assigned to the group, it will not be assigned twice.

Parameters:
Returns:

The IfcRelAssignsToGroup relationship or None if products was empty list.

Return type:

Union[ifcopenshell.entity_instance, None]

Example:

group = ifcopenshell.api.run("group.add_group", model, Name="Furniture")
ifcopenshell.api.run("group.assign_group", model,
    products=model.by_type("IfcFurniture"), group=group)