mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
fixed bug in system.get_connected_to / get_connected_from
import was missing
This commit is contained in:
@@ -17,6 +17,8 @@
|
|||||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
import ifcopenshell.util
|
||||||
|
|
||||||
group_types = {
|
group_types = {
|
||||||
"IfcZone": ("IfcZone", "IfcSpace", "IfcSpatialZone"),
|
"IfcZone": ("IfcZone", "IfcSpace", "IfcSpatialZone"),
|
||||||
"IfcBuiltSystem": (
|
"IfcBuiltSystem": (
|
||||||
@@ -82,6 +84,7 @@ def get_connected_port(port):
|
|||||||
return rel.RelatingPort
|
return rel.RelatingPort
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: cover in tests
|
||||||
def get_connected_to(element):
|
def get_connected_to(element):
|
||||||
results = []
|
results = []
|
||||||
for port in ifcopenshell.util.system.get_ports(element):
|
for port in ifcopenshell.util.system.get_ports(element):
|
||||||
@@ -96,9 +99,10 @@ def get_connected_to(element):
|
|||||||
for relConPortToElement in disPort.ContainedIn:
|
for relConPortToElement in disPort.ContainedIn:
|
||||||
if relConPortToElement.RelatedElement != element:
|
if relConPortToElement.RelatedElement != element:
|
||||||
results.append(relConPortToElement.RelatedElement)
|
results.append(relConPortToElement.RelatedElement)
|
||||||
return(results)
|
return results
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: cover in tests
|
||||||
def get_connected_from(element):
|
def get_connected_from(element):
|
||||||
results = []
|
results = []
|
||||||
for port in ifcopenshell.util.system.get_ports(element):
|
for port in ifcopenshell.util.system.get_ports(element):
|
||||||
@@ -113,4 +117,4 @@ def get_connected_from(element):
|
|||||||
for relConPortToElement in disPort.ContainedIn:
|
for relConPortToElement in disPort.ContainedIn:
|
||||||
if relConPortToElement.RelatedElement != element:
|
if relConPortToElement.RelatedElement != element:
|
||||||
results.append(relConPortToElement.RelatedElement)
|
results.append(relConPortToElement.RelatedElement)
|
||||||
return(results)
|
return results
|
||||||
|
|||||||
Reference in New Issue
Block a user