Sort Columns by XY Coordinates + Add values from upper to lower levels

Hi all! First of all sorry if i will ask something stupid but i’m noob about using dynamo on revit.
That’s my problem for my Structural model.
Structural columns are divided per levels. Every columns have its resistance value KN (number parameter)
I would like to select all columns that are aligned vertically in the model and then, starting from the upper ones, add the resistance value to the one below and so on till the lower ones.

Thanks to all

Hi Niccoló, welcome to the forum,
Everyone has been a beginner at some time, you’ll get the hang of it
Start by reading this post - How to get help on the Dynamo forums and here Dynamo Primer

Here is one way to achieve what you are trying to do - you will have to adapt to your circumstances
Dig in and give it a go

Hi Mike and thanks for your answer! I’ve tried your work but something goes wrong. But in the meanwhile I’ve tried to do something by myself and that’s the result

I’m very happy of the result but now i’m again stopped. I’ve found the way to select only columns thata have same XY but different Z.

Then I’ve taken the ones that are on the upper level (color Red) and I can assign to them the value that I want.

Now that’s the problem: I would like to repeat this operation to find the columns colored Green. Then Then assign the value that is made by the Sum of Red and Green.

Then again repeat for the columns Blue (sum of values from red+green+blue)