# Filtering unconnected pipes

**URL:** <https://forum.dynamobim.com/t/filtering-unconnected-pipes/92097>\
**Category:** Lists-Logic\
**Tags:** mep, list-filter, mepover\
**Created:** [July 24, 2023, 10:45am UTC](https://forum.dynamobim.com/t/filtering-unconnected-pipes/92097 "2023-07-24T10:45:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BIM\_Mrbrango](https://avatars.discourse-cdn.com/v4/letter/b/a183cd/32.png) [@BIM\_Mrbrango](https://forum.dynamobim.com/u/BIM_Mrbrango)\
**Post date:** [July 24, 2023, 10:45am UTC](https://forum.dynamobim.com/t/filtering-unconnected-pipes/92097/1 "2023-07-24T10:45:06Z")

</div>

Hi, need your help finding the pipes that are Not connected so I can determine if it is a tee-fitting or an elbow to vertical pipe.

As can be seen in the pic. I’ve got 57 horizontal pipes and 27 elbows are created, now I need to find those pipes that not has an elbow connected and try to connect to vertical pipes or even make a tee-fitting.

But I cant get the result I need to further process.

Feel free to comment on the approach

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/1/11a50b3a7b9437460e4e1d3c302e701ebec3b79d.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/4/147ed4028cd98dd88f5b4ed242d00a566fc7099d.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/4/b4c49b8e75542634699d72a205e3a0e5a6fe6019.png)

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [July 24, 2023, 11:41am UTC](https://forum.dynamobim.com/t/filtering-unconnected-pipes/92097/2 "2023-07-24T11:41:03Z")

</div>

@BIM_Mrbrango ,

it seems to be deeper in the element…

i am just able to collect the stuff

```auto
#Template 
#DraxlA
#19.07.2023
import clr
import sys 

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
from Autodesk.Revit.DB.Plumbing import *
from Autodesk.Revit.DB.Mechanical import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#functions
def tolist(x):
    if hasattr(x,' __iter__'): return x
    else: return [x]

#collector
collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_PipeCurves)
all_elements = collector.WhereElementIsNotElementType().ToElements()

elements = UnwrapElement(tolist(all_elements))

output = []

for i in elements:
	output.append(i.IsConnected)

OUT = output

```

when you look via LOOKupTable, it is in the _connector-manager_

 ![grafik](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/8/d803f83391d7f82e815745493e81a8b4b85580ab.png)

> **[IsConnected Property](https://www.revitapidocs.com/2015/84d067ae-d08b-1345-55ce-8086c24cc538.htm)**
>
> Online Documentation for Autodesk's Revit API: 2015, 2016, 2017, 2017.1, 2018

KR

Andreas

---

<div class="post-metadata">

**Author:** ![BIM\_Mrbrango](https://avatars.discourse-cdn.com/v4/letter/b/a183cd/32.png) [@BIM\_Mrbrango](https://forum.dynamobim.com/u/BIM_Mrbrango)\
**Post date:** [July 24, 2023, 2:53pm UTC](https://forum.dynamobim.com/t/filtering-unconnected-pipes/92097/3 "2023-07-24T14:53:39Z")

</div>

Hi Andreas,

Thanks for mentioning IsConnected, I think I can use that insted of element.id.  
I’ll get back to you!
