Pull values from sublist, add new values to sublist

I am trying to pull out some data from sublists AND IF the data is the same, then I would like the next sublist data to add up. (please see the image below).
The objective is to create one “routine” that permits my office to calculate the total Netto area of a serie of appartmens in a Building Block based on Revit Information and then export it to Excel for further processing.

I just started studying Dynamo a couple a weeks ago, I don’t know if my posted Workflow even make sense/or plausible.

Thank you all in advance for your Inputs.

try to see the below post… this is a kind of ‘GroupByKey’ problem

@erfajo Thank you for your help and sorry for the late answer. I am not having so much time to play with Dynamo after work lately.
Indeed the “GroupByKey” kind of sorted out my list and helped me to organize this script. Actually I got almost what I want. The script works now if we specific one Item from the list - “3” in this case. My goal is but to add all the areas that have the same apartment number (which is represented by the index 1 in all the sub lists).

Do I have to play around with the Code Node which is set for the value “3” (indicates the apartment 3)?
Thanks again for the possible Input!

The .dyn and .rvt files:

170512 Test Fläche Code with several Apartments.dyn (17.9 KB)
170503 Test Fläche 2017.rvt (1016 KB)

@JFK I tried with simple out of the box nodes.

@erfajo , @Ritesh_Chandawar thank you both for the answers with different approaches. I will try to learn something from your both scripts since I’m new to Dynamo and Coding.


Going the OOTB way is indeed very simple, That was aslo described in the same post that I referred to earlier… and as previously, added a sorting in the end of the graph, just if you need that.

170512 Test Fläche Code with several Apartments-OOTB.dyn (13.1 KB)


Since there seems to be a need for this feature have I turned this into a node and added it to the DanEDU Dynamo package.

170512 Test Fläche Code with several Apartments-node.dyn (11.4 KB)

1 Like