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.
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
namespace Revit.SDK.Samples.HelloRevit.CS
{
[Transaction(TransactionMode.Manual)]
public class Command : IExternalCommand
{
public Result Execute(ExternalCommandData commandData,
ref string message,
ElementSet elements)
{
UIApplication uiApp = commandData.Application;
foreach (Element ele in
uiApp.ActiveUIDocument.Selection.Elements)
{
Panel panel = ele as Panel;
PanelType panelType =
doc.GetElement(panel.GetTypeId()) as PanelType;
if (null != panelType)
{
ElementId id =
panelType.get_Parameter(
BuiltInParameter.MATERIAL_ID_PARAM).AsElementId();
if (id != null)
{
Material mat = doc.GetElement(id) as Material;
TaskDialog.Show("Material Name", mat.Name);
}
}
}
return Result.Succeeded;
}
}
}
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.