Get center of gravity from Generic model family

Hi all

Im seams to have problem that I cant figure out. Im new in Dynamo .

I have generic model family that is build from nested families.
There is no SOLIDS in that family.
How can I get centre of gravity from that generic family???


You can use the centroid node. Be aware if your element has uniform density. If this is the case follow this:


Thanks for your time here

I have tried this bbut no success

you probably need to flatten the list and since it is one element, get rid of solid.byunion.

1 Like

Thanks for your time again

There is empty list .

It works fine if I select generic model that have solid in it.But my family is build from loads of nested components and there is no solids ate all

Hit the pin for the first node as well. If you can share the family, you allow the forum to experiment with it and give a more accurate solution.

1 Like

Adding another way. You can place a bounding box around it and find the center of that. I have found this to be a good way.

Sorry for just popping in really quick.

1 Like

How you do this @Steven ???

Ill send family tomorrow once i get back to work @xavier.loayza

Try this,


1 Like

Hi witch version @Steven you running im running 1.21 I have downloaded Clockworks for 1.03 bcoz next one up is 1.32

and I cant find node “”


I did think that was a new one. I am on 1.32 sorry.

Off the top of my head (I know there is a better way) get the min and max points of the BBox > line by two points > then the .5 parameter of the line (its center point). That will give you the center as well. I do not have dynamo at the moment to figure out the better way.

1 Like

I have attached family Fam1.rfa (912 KB)

All I want is get centre of it so I can then create views based on centre point


Get the bounding box of the element, use BoundingBox.ToCuboid to get the geometry of the bbox then get the center of your bbox with Solid.Centroid.

1 Like

Can any one point me out here pls??

I got centre now by my views not getting created can any one explain me his please Element View Generation.dyn (32.1 KB)


None of your nodes are visible. Zoom in until you can read the nodes then use the camera button in the top right corner to take a screenshot of your graph. Make sure you show the preview window for all nodes.

Centroid.dyn (8.8 KB)
Centroid.rvt (2.0 MB)

@dkeinys This should work most of the time, but might fail when there are other structural components within the bounding box of the family concerned.


1 Like

Thanks all got it working!!!


I also want to know how to get CG from revit family.