Finding the Center of Gravity for Multiple Elements

Just as a heads up, the current version of Dynamo I’m running is & due to software restrictions at my office I’m unable to upgrade to a newer version.

I have a model in Revit 2016 (image below) that I’m trying to locate, with either XYZ coordinates, or by a existing family contained in the model, its centroid/center of gravity, but the closest I have been able to get is locating the center for each individual family, not the entire model as one. I’ve tried creating Groups, Parts & Assemblies but it doesn’t seem to work. I feel like I’m missing something obvious.

Is there a way to find the centroid of multiple elements?

@eseanq Use Solid.ByUnion to join the multiple elements


So I was able to recreate what you have shown, but I’m still struggling to figure out what nodes get swapped in/out, and when I think I’ve got it, it gets hung up on the Solid.ByUnion

Check if anything I did here can help out! :slight_smile:

1 Like

I rearranged the nodes, and while it ran, the family I have set for CoG was still placed multiple times.

Introduce a Flatten node between Element.Geometry and Solid.ByUnion


It worked!

Now I just have to scale my test up towards my main model.

1 Like

Hello @Vikram_Subbaiah,
I am calculating center of gravity for multiple elements of structural column and structural framing category elements.
But after selecting elements script generating error!
Can you please help me in solving this problem?
Here is elements I am selecting:
Here is my Dynamo script:

After running script it is giving following error:

Nodes giving error:

  1. Element.Geometry - Warning: One or more geometries have failed to convert due to this error: Unable to trim surface as the input loop geometry could be illegal.

  2. Solid.ByUnion - Warning: Solid.ByUnion operation failed.
    Unable union two Solids : EDGECOIN_PROBLEM – system inconsistency processing edge coincidence.

Anyone have any idea please suggest me!
Thank you in advance!

I wanted to upload a combined dyn for eseanq’s problem and Vikram_Subbaiah’s suggestions that orks perfectly to generate a family at the centroid of multiple revit objects but it seems new users arn’t allowed to upload