New API for connecting and disconnecting elements

This commit is contained in:
Dion Moult
2022-10-25 17:54:24 +11:00
parent fb786bb90c
commit 7ff1b8a34d
5 changed files with 242 additions and 0 deletions
@@ -36,6 +36,8 @@ class Usecase:
def execute(self):
incompatible_connections = []
for rel in self.settings["relating_element"].ConnectedTo:
if not rel.is_a("IfcRelConnectsPathElements"):
continue
if rel.RelatedElement == self.settings["related_element"]:
incompatible_connections.append(rel)
elif (
@@ -45,6 +47,8 @@ class Usecase:
incompatible_connections.append(rel)
for rel in self.settings["relating_element"].ConnectedFrom:
if not rel.is_a("IfcRelConnectsPathElements"):
continue
if (
rel.RelatedConnectionType in ["ATSTART", "ATEND"]
and rel.RelatedConnectionType == self.settings["relating_connection"]
@@ -52,6 +56,8 @@ class Usecase:
incompatible_connections.append(rel)
for rel in self.settings["related_element"].ConnectedFrom:
if not rel.is_a("IfcRelConnectsPathElements"):
continue
if (
rel.RelatedConnectionType in ["ATSTART", "ATEND"]
and rel.RelatedConnectionType == self.settings["related_connection"]
@@ -59,6 +65,8 @@ class Usecase:
incompatible_connections.append(rel)
for rel in self.settings["related_element"].ConnectedTo:
if not rel.is_a("IfcRelConnectsPathElements"):
continue
if rel.RelatedElement == self.settings["relating_element"]:
incompatible_connections.append(rel)
elif (