Calculating individual material volume and name lists

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)

1 Like

Anybody have any suggestions?

Is this what you want?

summaterials.dyn (7.0 KB)


Thank you Einar, this is exactly what I was looking for. :slight_smile:

Hello Einar,

Still there?
I tried to use your file summaterials.dyn but I had a message "Error: The custom node definition is not loaded. "; Can you help me?

OUPS, forgot to say that it is about the Element.Materials node

@delachapelleb you need the Clockwork package


Ok I went to the cockwork site, an I read the Clockwork Node Index; I found the Element.Materials but couldn’t get it; for the clockwork package you have to pay?


Thx again Salvatore
The first step is ok now !
But I can t get no value from the node even with the same file (Dynamo-calculate list of materials.rvt). I m using a student version of Revit at home, but at my office tomorrow I m gone a try the dynamo.