# Programmatically Measuring Ductwork

I am working as an acoustician and I am looking to start writing Revit and/or Dynamo programs to simplify and automate my work. To this end, I am looking to start by creating a program that takes an HVAC system and calculates the noise is is going to generate in a building.

The inputs of my program will be the Revit geometry of the system (comprised of the head in equipment such as an AHU, the ductwork itself, and various diffusers). The output will simply be the internal surface area of the duct leading up to any given diffuser. Of course the width and height of each part of the duct is needed for this calculation as well as its length, which is the part I am having trouble with. As far as I can tell, each duct in Revit knows its Width, Length, and Height, but not the length from start to a point where it branches. It only knows its total length.

Would it be possible in the Dynamo environment to get the length of the path from AHU to diffuser? One idea I had would be to draw a line through the center of each piece of duct and consider there to be a junction where the lines cross. This would require getting the XYZ coordinates of each piece and plotting a line through each. Then somehow connect these points to get a simplified representation of the ductworkâ€¦ I am wondering, can any of you more experienced users think of the sort of nodes I would be wanting to use to make a program like this?

1 Like

Looking at this from another angle:
To get the total area of the ductwork, why not just get the area of the surfaces which comprise the ductwork?
Element.Geometry,
Geometry.Explode,
Surface.Area,
Math.Sum with longest lacing,
Element.SetParameterByName to write the value to the duct element.

Jacob,

I totally agree-- that is the way this problem should be solved (and I appreciate the references to useful functions!) The problem is that when considering sound absorbed by the walls of the ductwork, we are really only concerned with the surface area along the path from the sound source to the point where the sound exits the duct. Along this path, there can be any number of junctions which can split up a single duct, making calculation by each ducts total surface area not enough.