Sorting/Filtering Curtain Panel Geometry by Material

Hello, I am working with curtain panel families that consist of multiple materials. The base case contains Glazing and Spandrel. Parameters are built into each family to identify the glazing and spandrel materials e.g. “GL-1” and “Aluminum”.

I’d like to extract these material info and add them as attributes (via Elefront) to Rhino geometries within Rhino.Inside. This will eventually help with various takeoff data that cross-reference different panel properties e.g. Operable windows on the South office stack that feature GL-2. Pivot tables from Revit Schedules is one way to go but is there any way I can extract material data directly from Element Geometries?

The closest I’ve gotten is using Element Materials and Material Quantities - but these only provide a single area value for the whole panel. There is a Volume output per material, which is nice to have but requires division by depth (which varies by material) to arrive at a surface area. However,

Another workaround is to apply the formula used to create the curtain panels in the first place e.g. 3’ height for spandrel, with the remainder is allocated to glazing. It’s simple and flexible enough but I’d prefer to extract data directly from the panel itself.

On a related note, I did try asking ChatGPT for a Python script for the job … which it did so promptly. Thing is, I then end up getting non-stop “G is not a Brep” errors despite the geometry inputs being closed breps.


Code below:

import clr

from System import Enum

import rhinoscriptsyntax as rs
import Rhino
from RhinoInside.Revit import Revit, Convert
from Autodesk.Revit import DB

doc = Revit.ActiveDBDocument

if doc is not None:
if isinstance(G, Rhino.Geometry.Brep):
# Convert Brep to DB.Solid if needed
solid = Convert.Geometry.ToRevit(G, DB.Options())
if solid is not None:
gobj_mats = set(x.MaterialElementId.IntegerValue for x in solid.Faces)
if gobj_mats:
M = [doc.GetElement(DB.ElementId(x)) for x in gobj_mats if doc.GetElement(DB.ElementId(x))]
if M:
# Process M as needed
print(“Material elements retrieved successfully.”)
print(“Material elements not found in the document.”)
print(“No material IDs associated with the solid faces.”)
print(“Failed to convert Brep to Solid.”)
print(“Geometry G is not a Brep.”)
print(“No active Revit document.”)

Hi Clarence,

Can you post your about info?

The Revit Panel Family would be helpful in this case as well. Thanks.

Sure! We are using Rhino 7 and Revit 2023. Details below:

Rhino.Inside Revit: 1.12.8449.6358 (2023-02-18T03:31:56)

[Expanded Information]
Rhino: 7.33.23248.13001 (Rhino 7)
Revit: 2023.1.30 (
CLR: 4.0.30319.42000 (4.8.9195.0)
OS: Microsoft Windows NT 10.0.19045.0

There are about a dozen CW families in the model so I’ve selected a typical one
EWS-Example.rfa (624 KB)

If there’s a direct way to extract/filter/sort Element Geometries within a CW family by their Materials, that’d be awesome!

There is, but you might not like it.

Here I added a subcategory to the Family for all the parts of the Curtain Panel that need materials.

Then in the Project go add the Material to the SubCategory

Then expand your Element Geometry component to get the Category & corresponding geometry.

Many thanks Japhy! It is quite a hack - seems like one has to workaround Revit’s limitations in order to extract the material info. Is it right to conclude that SubCategories is the only means by which materials (and maybe other parameters) can be “passed on” to Element Geometries?

Correct, the above will allow you to sort and filter as needed for your baking attribute assignments.

1 Like

You’re the man! This is the missing piece of the puzzle for me - for the longest time, I couldn’t figure out the link (or lack of) between Revit families and their constituent geometries once the family has gone through Element Geometries.

Just wanted to add that every geometry has to be assigned a subcategory - or unassigned geometries will assume the next available material. I think Japhy made this clear but I missed the implication of not assigning subcategories for each piece of geometry and wound up with mullions getting categorized as glazing.