Hi. I’m attempting to calculate the total volume of each material in each category. For this example I will use walls. I would like to create a list containing sub-lists containing the material name, followed by the material volume. There should be no duplication of materials, so if more than one wall uses the material “Masonry - Concrete Blocks” it should only be displayed once with a combined volume of that material.
I’m using the below script to do this. However, I’m having some problems with the material volumes. In the below image, the List.transpose node with the preview shows the material IDs along with the correct volumes. The following nodes filter out duplicates to ensure each material is only shown once. Somewhere along the way (between the List.GroupByKey node and List.Clean node) the material volumes are combined with the volumes above it (material 2 combines with material 1, material 3 combines with material 1+2, material 4 combines with materials 1+2+3 and so on).
I would greatly appreciate it if someone could help me to reach a solution whereby the volumes do not automatically combine with those in the list above it. The above script has been recycled from here.
I have attached the .dyn file along with a basic Revit file I have been using for testing.
Any help would be appreciated.
Read Material Volumes - To upload.dyn (12.2 KB)
Dynamo - Calculate list of materials.rvt (408 KB)