Creating a graph for centroids of all shapes

I am trying to create a Dynamo script that calculates the centroid of each wall shape in Revit and places a marker at the calculated centroid. The image below is an example of the wall geometry I am working with.

This is my first time using Dynamo, so I would appreciate any guidance on what I may be doing incorrectly or how I can improve the workflow. My goal is for the script to identify each individual shape or family, calculate its geometric centroid, and automatically place a point or marker at that centroid.

Any advice, corrections, or suggestions for a better approach would be greatly appreciated. Thank you.

Hello @KiaraAnashpaul and welcome to the forum…not really sure so here is some option you could try

select models elements - get location _ point at parameter 0.5
or maybe
select models element - element solids - solids centroid

What kind of marker will you insert ? a 2d view specific ? or a 3d marker ?

Assuming you mean the true definition of centroid, then the Dynamo node Solid.Centroid should work. The graph would be:

  1. Element.Solids to get all solids which make up the element.
  2. Solid.ByUnion to combine any split elements into a single solid.
  3. Solid.Centroid to get the centroid of the solid.

The assumption above is a big one though; remember that a centroid doesn’t necessarily have to be on the geometry itself (thing of a donut) so your market might not touch the element.

@KiaraAnashpaul

You can use BriMohareb_xxxx pak. To get all cross section properties "BriMohareb_XXXX" Package for RevitXXXX Thread

If you need only cg use @jacob.small recommendations