Using a dictionary two layers deep: air terminal tag info > neck size > corresponding airflow

Hello,

I’m having issues with organizing data a few layers down. I’m working on an existing buildings, and I’ve calculated new airflow values and assigned them to the Spaces in the project. What I’m trying to do now is get the existing air terminals per Space, get the type of the air terminal, find the neck size for that type, and find the corresponding maximum airflow for that neck size. Since there are different types of air terminals with the range of neck sizes but different maximum airflows at those neck sizes, I’m trying to keep the neck sizes and airflow information together as I process the model data. I’ve used a Dictionary to sort out the available neck sizes/max airflows by the type of air terminal, but I’m stumped after that. I want to feed into another Dictionary to get the airflows that match the neck size, but I’m having problems manipulating the lists to do so. Each neck size entry from the model has a corresponding list of necks and airflows in a sublist. I thought I’d use GetItemAtIndex to get all of the lists of necks, then do the same for all of the lists of airflows, then feed them into the dictionary (both list lengths match at different levels).

Perhaps there is a better way of doing all of this that does not include going this route?

@JoeB file first:To_Joe_Air_Terminal.dyn (24.3 KB)

There’re many ways to achieve it and one of them doesn’t involve Dynamo :point_down:.

Revit Sample Project:

The .dyn file I uploaded mainly focusing on manipulating List. But it starts from all terminals instead of all spaces.

Still, if using Dynamo, I would recommend a single Python node iterating through Space => find its terminals => retrieve data from the type of terminal instance. You won’t lose relationship.

Space has method IsPointInSpace whereas terminal has LocationPoint. Document has method GetSpaceAtPoint. FamilyInstance (terminal) has Space property. So they’re helpful for associating Space to Air Terminal or the other way around.

Additional info :point_down::

Space.IsPointInSpace
https://www.revitapidocs.com/2019/f107fbd8-4e76-735a-78d5-d640a266b3a3.htm

Document.GetSpaceAtPoint
https://www.revitapidocs.com/2019/2de00d88-4a8b-0009-0f21-94c5f8f5d671.htm

FamilyInstance.Space
https://www.revitapidocs.com/2019/ea6bc434-d938-d0e5-ecc3-33e37dbf1d1b.htm

As usual, you make a good point, @jshial. I input the airflow info into the OOTB Max Flow parameters, and I’m directly reading that information per space; no need to go from elements to tags to necks to airflows. I was able to clean up my script a lot.

Thank you

1 Like