Revit and Dynamo – Finding the Centroid (CoG) of Revit elements

I was recently asked by a contractor if Revit could report on the centroid of selected objects to facilitate crane lifts. For those of you that know Revit well the answer if normally no. However, Dynamo is really useful for this sort of task. I have created a simple family to represent the Centroid and added three shared parameters to report on the X,Y and Z coordinates.

Centroid

As you can see from the above Dynamo graph the method is fairly simple and can be really useful for a number of scenarios in construction planning.

Here is a quick video showing the use of the Dynamo Graph.

Centroid

Advertisements

About lawrenceh

I am employed by Excitech, one of the largest Autodesk resellers in the UK, to provide training and other services such as implementation and project support to our clients. The main products I get involved with are Autodesk Revit Structure, Dynamo & Autodesk Inventor. My personal interests include aviation, engineering and walking.
This entry was posted in Tips and Tricks and tagged , , , , . Bookmark the permalink.

18 Responses to Revit and Dynamo – Finding the Centroid (CoG) of Revit elements

  1. Pingback: Revit and Dynamo – Finding the Centroid (CoG) of Revit elements - Revit news

  2. Pingback: Weekly Roundup – 2017.11 – The BIMsider

  3. Tom Panzenhagen says:

    Thank you for this post, very helpful. Is it possible to get the dimensions (Length and Width) from a specific corner of the element to the center of gravity? If so, any suggestions on how to pull that information?

    • lawrenceh says:

      Hi Tom,

      We can get the bounding box and then work out the x and y from the centroid. It will depend on the shape of the element. Perhaps we could get a parameter value for length or width and get the value?

      • Tom says:

        I was not able to find a way to link the two (centroid and the bounding box) so gave up on that. But thanks for the suggestion.

  4. nancy says:

    @ Lawrenceh – Can I have clearer image of the dynamo graph? or a file sample . I have the same problem and this would really help me so much!

  5. Vinod Venkatesh says:

    Hi Lawrenceh,
    Thanks for the article, I can get the CoG based on density.
    But I am wondering is there a way to calculate CoG based on weight? i want Revit to consider the form and weight of an object.

    • lawrenceh says:

      Hi Vinod, the blog is really describing centre of mass as opposed to centre of gravity. Just out of interest, what is the reason that you require this variance?

  6. lawrenceh says:

    Hi Nancy, You should just be able to ‘zoom up’ on the post image. they are all 300ppi.

  7. Vinod Venkatesh says:

    Hi Lawrenceh,
    I need to find out the Centre of buoyancy and Centre of gravity,the structural element would be combination of wood and concrete, so based on the concrete and wood weight the Centre of buoyancy and gravity changes.

  8. lawrenceh says:

    Hi Vinod,

    I think you can cut the solid at the water level and then calculate the CoG of the displaced water (the solid volume under water).

  9. Vinod Venkatesh says:

    Thank you Lawrenceh, so what i understand is i need to calculate individual element based on respective element weight right..

  10. lawrenceh says:

    I think this will be correct. I would image that you could create a model line in Revit to represent the water level, create a surface in Dynamo and then use this to split the solids. You can then find the centroid of this which should be the centre of buoyancy

  11. Vinod Venkatesh says:

    Hi Lawrenceh,
    Sorry to bother, is CoG is totally dependent on shape of geometry or also weight of the geometry? is there any possible way to calculate the CoG of multiple elements of same volume but different weight.

  12. jh says:

    Hi Lawrence,
    This is exactly what I am after.
    Is it possible to post a more high-res image of the Graph – It is a little bit too hard to read.

    JH

  13. Linda Tien says:

    hi Lawrenceh,
    Thank you for the article.
    But I am having trouble when selecting model elements.
    In my block of Element.Geometry and Flatten, it shows that my element contain solid and line, so it cannot be done when I use Solid.ByUnion because line is not solid.

    So exactly how can I select my elements by solid only? (I have already turned off the analytical model before selecting.)

    Thank you again.

    • lawrenceh says:

      Hi,

      I think the best approach here is to filter your elements so only solids can pass into the union node. Try getting the element.name and then using the == node to return true or false. You can then filter the list of elements by the Boolean mask.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s