Duct/Pipe Network Connection Elements

Hi,
How can I get the Mechanical Equipment connected to particular Air Terminals or Accessory in a model?

Hello @theshysnail

A Python solution to find all elements by system with a selected element in input

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

def getElemBySystem(elem):
	"""
	find all the elements of the 1st system found
	"""
	mepsys, elemsSys = None , None
	connSet = elem.MEPModel.ConnectorManager.Connectors
	for con in connSet:
		if con.IsConnected:
			mepsys = con.MEPSystem 
			elemsSys = list(mepsys.Elements)
			break
	return 	mepsys, elemsSys	
			
systems = []		
elemout = []
toIter = lambda x : x if hasattr(x, "__iter__") else [ x ]
elems = toIter(UnwrapElement(IN[0]))

for e in elems:
	sytem, elemSys = getElemBySystem(e)
	elemout.append(elemSys)
	systems.append(sytem)
OUT = systems, elemout

2 Likes

Thanks.
From what I understand, it’s giving me all the Mehanical Equipment and accessories in the network when I select an MEP accessory (not duct or pipe).

yes then you can filter elements before or after python script (by Category for example)

1 Like