Whenever there is a requirement to access any specific parameter value of an element, like the Material value of a Panel, in this case, Revit LookUp tool often provides the exact approach required to access the desired information.
So getting back to this specific case, we can create an instance of the StoreFront curtain wall type and select a panel and drill in through the instance (and/or type) parameters to see which one contains the Materials based information (this can be also figured out using UI). In this case, the Material information of a standard curtain wall panel is stored in the PanelType. And based on this information as obtained from the LookUp tool, the following code should help extract (and if required, set) the Curtain Wall panel.
public class Command : IExternalCommand
public Result Execute(ExternalCommandData commandData,
ref string message,
UIApplication uiApp = commandData.Application;
foreach (Element ele in
Panel panel = ele as Panel;
PanelType panelType =
doc.GetElement(panel.GetTypeId()) as PanelType;
if (null != panelType)
ElementId id =
if (id != null)
Material mat = doc.GetElement(id) as Material;
TaskDialog.Show("Material Name", mat.Name);
If you have a custom curtain wall, the approach will be different and you can get an idea of how to access the required parameter values using the Revit LookUp tool again.