Use dynamo to find center of gravity associated to the weight of each element

Hi everyone.
I’m learning use Dynamo for Revit. My aim is to find the Center of Gravity of a building in steel including the architerctural parts and the MEP parts.
I found a script to find the centroid of each element but my problem is that i have to link this one with the weight of the respective element. i find The weight of each element using the functions in the section fields of the schedules.

If you need further info in order to understand i will answer

Hi Maria, welcome to the Dynamo forum

Please check out this post How to get help on the Dynamo forums

Is it possible to get some more detail or what you have attempted so far?

The way to calculate is to use the mean of weighted coordinates

  • Multiply each centroid by it’s mass
  • Add them together and divide by the sum of the masses

You could do it like this

Point.AsVector, Vector.Scale might help here too. I do think you need to scale your values relative to the average of the centroids though, but it’s been awhile since I have had to deal with physics.