Tie and sum data from values in upper list level to repeat element in sub list?

(Not sure if this should go under “Lists - Logic” or “Revit”…?)

Is it possible (without a database) to create a list that looks at an item at L1 and its L2 value, and if that item at L1 repeats under additional, different L2 values, can be combined with a summed L2 total?

The goal: If a part number repeats under multiple lengths in the Revit model, I want to compile to the total length of that part that lives in the model.
(I am pulling Part Length instances and summing those totals, then assigning the numbers in the code block.)

For example and shown below:

Where L2, index 0 = 43.3125, @L1, index 0, there is a part number 631-907.
Where L2, index 2, = 13.4375, @L1, index 0, 631-907 again occurs.

I would like to summarize that information so I get a total (sum) of the two L2 values
(43.3125+13.4375 = 56.75) and put that total under the L1 item 631-907.

Or in layman’s terms:

631-907 at 56.75 long

Here is where I left off, and want to write to Excel when I have this Sorted out.

I would try to structure your data better if possible…

1 Like