From 85e0fa9147d23b37c06368a0ffd475b9a8824b2f Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 28 Jan 2025 17:37:12 +0500 Subject: [PATCH] assign/unassign layer - mention representations --- .../ifcopenshell/api/layer/assign_layer.py | 4 ++-- .../ifcopenshell/api/layer/unassign_layer.py | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/layer/assign_layer.py b/src/ifcopenshell-python/ifcopenshell/api/layer/assign_layer.py index 5c4f3ee6e3..fa57e526cc 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/layer/assign_layer.py +++ b/src/ifcopenshell-python/ifcopenshell/api/layer/assign_layer.py @@ -22,7 +22,7 @@ import ifcopenshell def assign_layer( file: ifcopenshell.file, items: list[ifcopenshell.entity_instance], layer: ifcopenshell.entity_instance ) -> None: - """Assigns representation items to a layer + """Assigns representation items or representations to a layer In IFC, instead of objects being assigned to layers, representation items are assigned to layers. Representation items are portions of the @@ -31,7 +31,7 @@ def assign_layer( its frame) assigned to one layer, and another portion (e.g. the glazing panels) assigned to another layer. - :param items: The list of IfcRepresentationItems to assign to the layer. This + :param items: The list of IfcRepresentationItems / IfcRepresentations to assign to the layer. This should be the items from the object's IfcShapeRepresentation. :param layer: The IfcPresentationLayerAssignment layer to assign the item to. diff --git a/src/ifcopenshell-python/ifcopenshell/api/layer/unassign_layer.py b/src/ifcopenshell-python/ifcopenshell/api/layer/unassign_layer.py index 8fe93d3a91..97ae094a50 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/layer/unassign_layer.py +++ b/src/ifcopenshell-python/ifcopenshell/api/layer/unassign_layer.py @@ -23,14 +23,13 @@ import ifcopenshell.util.element def unassign_layer( file: ifcopenshell.file, items: list[ifcopenshell.entity_instance], layer: ifcopenshell.entity_instance ) -> None: - """Unassigns representation items from a layer + """Unassigns representation items or representations from a layer - If the representation item isn't assigned to the layer, nothing will - happen. + If the element isn't assigned to the layer, nothing will happen. If after unassignment layer won't have any assigned items it will be removed to keep IFC valid. - :param items: A list IfcRepresentationItem elements to unassign + :param items: A list IfcRepresentationItem / IfcRepresentation elements to unassign :param layer: The IfcPresentationLayerAssignment to unassign from :return: None