Calculating the volume of a specific material in a multimaterial object (expressions)

Is there a way to get the volume of a specific material used in a wall?

Currently, for multi-layer walls, I have to build each layer as a separate wall based on one sketch and nest all layers into the main wall.
To display the volume, you have to use rather complex constructions in expressions (you need to subtract the volumes of the layers from the total volume).
It looks like this: Wall.Shape.Volume - Wall001.Shape.Volume-Wall002.Shape.Volume

It is possible to make one wall, but specify the layers as separate materials. But I can’t find a way in expressions to get the volume of a separate layer (material).

I tried to find the required values in the expressions. But it seems that the material is not capable of accepting the value “volume”. Maybe there is some workaround?
I am attaching the file.

UPD/ I also can’t get a list of thicknesses that takes values from the control sketch (analogous to a table). The dimension is missing the second sign after the dot. (how to format data into float?)

This is not the first time I have encountered problems with data dimensionality. For example, to calculate the volume in cubic meters, I had to divide the variable by 1000000000 and then format the number leaving two decimal places. This is some kind of dark magic. Some overly complex parametrics. :frowning:

I think the idea with the control sketch is promising. There is no need to switch to the spredsheets or keep two windows (3D view + table). All changes that occur are available without unnecessary switching.

All parameters are available from the control sketch properties window

Funny situation. I can’t insert the data from the control sketch directly into the sheet (A;B;C;D) to specify the thickness of the multimaterial layers.
but if I insert the data from the control sketch into a spreadsheet, and then insert the resulting result into the sheet (A;B;C;D) in the multimaterial, then everything works.

Formatting through a spreadsheet (adding another zero after a period) is what I was really missing (not). I guessed that I wouldn’t be able to completely abandon the spreadsheet, but I didn’t imagine that it would be in this place.

However, this is not so bad. Transferring data to a table once and not opening it again is also a solution.