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


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::




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