Refactor to usecase as asked in #1881 (#1907)

This commit is contained in:
Cyril Waechter
2021-11-30 11:24:19 +01:00
committed by GitHub
parent 4f7bfec026
commit d1caa3242f
2 changed files with 22 additions and 3 deletions
@@ -0,0 +1,19 @@
class Usecase:
def __init__(self, file, **kwargs):
"""location, axis and ref_direction defines the plane"""
self.file = file
self.entity: "IfcRelSpaceBoundary"
self.relating_space: "IfcSpace | IfcExternalSpatialElement"
self.related_building_element: "IfcElement"
self.parent_boundary: "IfcRelSpaceBoundary" = None
self.corresponding_boundary: "IfcRelSpaceBoundary" = None
for key, value in kwargs.items():
setattr(self, key, value)
def execute(self):
self.entity.RelatingSpace = self.relating_space
self.entity.RelatedBuildingElement = self.related_building_element
if hasattr(self.entity, "ParentBoundary"):
self.entity.ParentBoundary = self.parent_boundary
if hasattr(self.entity, "CorrespondingBoundary"):
self.entity.CorrespondingBoundary = self.corresponding_boundary