Calculating the glass in a door

A reader asks:

>> I’d be curious to know if it’s possible to pull areas from an object like a door. For example, if I selected the door, can I calculate the area of (object style) glass in the family?

Yes, and here is how to do it with the wonderful GetMaterialArea method:

Element element = doc.GetElement(uidoc.Selection.PickObject(ObjectType.Element));
string areaData = "";
foreach (Material material in element.Materials)
    areaData += material.Name + ", " + element.GetMaterialArea(material) + "\n";
TaskDialog.Show("Materials & Area", areaData);


3 thoughts on “Calculating the glass in a door

  1. Now you made that look too easy! Let’s say I have a 7′ tall, full glass door. How complicated would it be to add constraints, or limits, to the area in which you want to calculate? Say I want to calculate the total are of glass between 2′ and 6′ (assuming the total glass area was greater than that).

    Appreciate the help Harry!

    • This could be done by using the family editor API to create voids that cut the door at the desired heights, get the areas, and then rollback the transaction so that the void creation is “un-done” and the door geometry is unchanged.

  2. Hello! this is a very nice post.
    I’ve been trying to apply to a model made in 2014 Revit version. But i couldnt. Can you please make an example about the changes in this last version
    Appreciate the help!

Leave a Reply

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

You are commenting using your 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 )

Connecting to %s