Check this thread for some ideas.
Also note the developers guide has an example (3-3) that says it highlights walls:
Hi,
Have you found anything interesting since?
Thanks.
ElementId elementId = new ElementId(id);
List<ElementId> ids = new List<ElementId>();
ids.Add(elementId);
UIDocument uiDoc = app.ActiveUIDocument;
uiDoc.Selection.SetElementIds(ids);
uiDoc.ShowElements(ids);
Try This:
Element myElement = doc.GetElement(uidoc.Selection.GetElementIds().First());
using (Transaction tx = new Transaction(doc))
{
tx.Start("Manual Color Override");
OverrideGraphicSettings ogs = new OverrideGraphicSettings();
OverrideGraphicSettings ogsCheeck = doc.ActiveView.GetElementOverrides(myElement.Id);
FillPatternElement myFillPattern = new FilteredElementCollector(doc).OfClass(typeof(FillPatternElement)).Cast<FillPatternElement>().First(a => a.Name.Contains("Solid fill"));
ogs.SetSurfaceBackgroundPatternId(myFillPattern.Id);
ogs.SetSurfaceBackgroundPatternColor(new Autodesk.Revit.DB.Color(255, 255, 0));
if (ogsCheeck.SurfaceBackgroundPatternId.IntegerValue != -1)
{
doc.ActiveView.SetElementOverrides(myElement.Id, new OverrideGraphicSettings()); //if it already has overwrites, this removes it.
}
else
{
doc.ActiveView.SetElementOverrides(myElement.Id, ogs);
}
uidoc.ActiveView.get_Parameter(BuiltInParameter.VIEW_DESCRIPTION).Set(myElement.Id.IntegerValue.ToString());
tx.Commit();
}