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.

Ah. An added wrinkle…
Since all you’re going to get stuck with is the connectors, utilizing a new curve from duct to duct that passes though the connector should allow you to use a ray bounce selection technique to isolate the selection to just surfaces which have a line of sight to the connector line. Obviously this gets more time consuming and elaborate as your systems get more complex, to the point that your run times may become counter productive (geometry tests are slow).

So instead of testing this for a thousand elements, I’d test on individual families to reduce the selection set. Perhaps even in the family environment. Make a new parameter for each connector, call it “total exposed surface area at output X” where X varies for each output. You can then sum these along the path from the source, and limit your in project geometry calculations to the area of the linear ductwork.