Adding values within Sublists

I am extracting Rebars data from Revit. I want to add the lengths of bars just like in Revit schedules footer for each diameter separately. I have created this list, it has 3 different diameters mixed up in List 0. I have to add diameters in List 1 also making sure that the items in List 0 also reduce instead of staying as much as they are.
Thanks in advance!


I think using List.GroupByKey will help you.

Thanks. I have tried it, but it groups them based on their shape instead of bar number. Also, can we use some sort of a loop to get items at any index and putting in separate lists?

Looks like your using something that isn’t just giving you the “Type” in terms of your schedule. If you can get that value to be correct it will then group correctly.

1 Like

I will have to see. Dynamo does not return the Type of rebar when I use the get parameter value node. And same is the case with stairs. Their volume is coming out to be zero

The Element.Name node is returning #3 : Shape 00 for instance, where is the “Shape 00” coming from? You can also sort by something else like Diameter assuming it corresponds to the Type (3/8" = #3). You can group like that even if you don’t end up using that information later in the graph.

It would be helpful to see an image of the entire graph with drop down preview. This way we better understand what all is going on.

Shape 00 and 01 are corresponding to straight bars and Stirrups. I am attaching the files. Dynamo is a bit of a mess, because I have been looking to solve my problem with other ways
Home.dyn (141.9 KB)