Getting the area of a single face

At “Revit in Plain English“, Jay mentions that Revit reports a single area value for a wall, but that he wants that actual area of a specific face.

Here is a quick document macro (not an application macro like in my other samples) to get the area of any face.

public void areaOneFace()
{
    Document doc = this.Document;    
    UIDocument uidoc = new UIDocument(doc);
    Reference myRef = uidoc.Selection.PickObject(ObjectType.Face, "Select a face");
    Element e = doc.GetElement(myRef);
    Face face = e.GetGeometryObjectFromReference(myRef) as Face;
    TaskDialog.Show("Area", "Area of face selected on element '" + e.Name + "' (" + e.Id + ")\n" + face.Area);
}

When the wall is attached to the roof so that the area of each side face is unique, the schedule reports the wall area as 619. With the macro we find that the area of each face is 618.52 and 568.08.

Advertisements

One thought on “Getting the area of a single face

  1. What would be interesting, if you could report all the faces on the boundery of a room, and put the sum of those faces in a room parameter. In adition you could look at the ceiling heigt and give the face surface where the ceiling interacts. This way you could store the area of the wall finish in your room parameters….just a suggestion

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s