mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Generate functions for all API usecases for better static code features. See #2693.
This commit is contained in:
+19
-22
@@ -21,28 +21,25 @@ import ifcopenshell.api
|
||||
import ifcopenshell.util.element
|
||||
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, relation=None):
|
||||
"""Removes a relationship between a connection and a condition
|
||||
def remove_structural_connection_condition(file, relation=None) -> None:
|
||||
"""Removes a relationship between a connection and a condition
|
||||
|
||||
The condition and the member itself is preserved.
|
||||
The condition and the member itself is preserved.
|
||||
|
||||
:param relation: The IfcRelConnectsStructuralMember to remove.
|
||||
:type relation: ifcopenshell.entity_instance
|
||||
:return: None
|
||||
:rtype: None
|
||||
"""
|
||||
self.file = file
|
||||
self.settings = {"relation": relation}
|
||||
:param relation: The IfcRelConnectsStructuralMember to remove.
|
||||
:type relation: ifcopenshell.entity_instance
|
||||
:return: None
|
||||
:rtype: None
|
||||
"""
|
||||
settings = {"relation": relation}
|
||||
|
||||
def execute(self):
|
||||
if self.settings["relation"].AppliedCondition:
|
||||
ifcopenshell.api.run(
|
||||
"structural.remove_structural_boundary_condition",
|
||||
self.file,
|
||||
connection=self.settings["relation"].RelatedStructuralConnection
|
||||
)
|
||||
history = self.settings["relation"].OwnerHistory
|
||||
self.file.remove(self.settings["relation"])
|
||||
if history:
|
||||
ifcopenshell.util.element.remove_deep2(self.file, history)
|
||||
if settings["relation"].AppliedCondition:
|
||||
ifcopenshell.api.run(
|
||||
"structural.remove_structural_boundary_condition",
|
||||
file,
|
||||
connection=settings["relation"].RelatedStructuralConnection,
|
||||
)
|
||||
history = settings["relation"].OwnerHistory
|
||||
file.remove(settings["relation"])
|
||||
if history:
|
||||
ifcopenshell.util.element.remove_deep2(file, history)
|
||||
|
||||
Reference in New Issue
Block a user