This commit is contained in:
Andrej730
2025-03-14 10:43:47 +05:00
parent 10ecac33b8
commit 0e8810c1f5
118 changed files with 869 additions and 1203 deletions
@@ -33,11 +33,8 @@ def add_filling(
filled.
:param opening: The IfcOpeningElement to fill with the element.
:type opening: ifcopenshell.entity_instance
:param element: The IfcElement to be inserted into the opening.
:type element: ifcopenshell.entity_instance
:return: The new IfcRelFillsElement relationship
:rtype: ifcopenshell.entity_instance
Example:
@@ -102,12 +99,10 @@ def add_filling(
# The door will now fill the opening.
ifcopenshell.api.feature.add_filling(model, opening=opening, element=door)
"""
settings = {"opening": opening, "element": element}
fills_voids = settings["element"].FillsVoids
fills_voids = element.FillsVoids
if fills_voids:
if fills_voids[0].RelatingOpeningElement == settings["opening"]:
if fills_voids[0].RelatingOpeningElement == opening:
return fills_voids[0]
history = fills_voids[0].OwnerHistory
file.remove(fills_voids[0])
@@ -117,6 +112,6 @@ def add_filling(
return file.create_entity(
"IfcRelFillsElement",
GlobalId=ifcopenshell.guid.new(),
RelatingOpeningElement=settings["opening"],
RelatedBuildingElement=settings["element"],
RelatingOpeningElement=opening,
RelatedBuildingElement=element,
)
@@ -28,9 +28,7 @@ def remove_filling(file: ifcopenshell.file, element: ifcopenshell.entity_instanc
fills the opening.
:param element: The element filling an opening.
:type element: ifcopenshell.entity_instance
:return: None
:rtype: None
Example:
@@ -52,10 +50,8 @@ def remove_filling(file: ifcopenshell.file, element: ifcopenshell.entity_instanc
# Not anymore!
ifcopenshell.api.feature.remove_filling(model, element=door)
"""
settings = {"element": element}
for rel in file.by_type("IfcRelFillsElement"):
if rel.RelatedBuildingElement == settings["element"]:
if rel.RelatedBuildingElement == element:
history = rel.OwnerHistory
file.remove(rel)
if history: