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

**URL:** <https://forum.dynamobim.com/t/use-dynamo-to-find-center-of-gravity-associated-to-the-weight-of-each-element/98977>\
**Category:** Dynamo Player\
**Created:** [March 11, 2024, 10:38am UTC](https://forum.dynamobim.com/t/use-dynamo-to-find-center-of-gravity-associated-to-the-weight-of-each-element/98977 "2024-03-11T10:38:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricciTCJPZ](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@ricciTCJPZ](https://forum.dynamobim.com/u/ricciTCJPZ)\
**Post date:** [March 11, 2024, 10:38am UTC](https://forum.dynamobim.com/t/use-dynamo-to-find-center-of-gravity-associated-to-the-weight-of-each-element/98977/1 "2024-03-11T10:38:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mike.Buttery](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Mike.Buttery](https://forum.dynamobim.com/u/Mike.Buttery)\
**Post date:** [March 12, 2024, 1:19am UTC](https://forum.dynamobim.com/t/use-dynamo-to-find-center-of-gravity-associated-to-the-weight-of-each-element/98977/2 "2024-03-12T01:19:11Z")

</div>

Hi Maria, welcome to the Dynamo forum

Please check out this post [How to get help on the Dynamo forums](https://forum.dynamobim.com/t/how-to-get-help-on-the-dynamo-forums/4677)

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

 ![Centre_of_mass_2024-03-12_09-20-11](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/f/8fe287dfe7d553085aa6db82b4f386cdaa32b65f.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [March 12, 2024, 7:08am UTC](https://forum.dynamobim.com/t/use-dynamo-to-find-center-of-gravity-associated-to-the-weight-of-each-element/98977/3 "2024-03-12T07:08:45Z")

</div>

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.
