Revit的構件顏色常見有三種。
1、材質顏色
2、視圖的可見性過濾器
3、管道系統的特殊顏色
從我的作品中摘抄片段吧
1、獲取構件材質
必須按面去獲取
material = m_Document.GetElement(face.MaterialElementId) as Material;
2、獲取過濾器的顏色
ICollection<ElementId> filterIds = v.GetFilters();
filterColors.Clear();
foreach (ElementId id in filterIds)
{
filterColors.Add(doc.GetElement(id) as ParameterFilterElement);
}
3、管道系統的材質顏色
if (elem is MEPCurve)
{
Parameter pm = elem.get_Parameter(BuiltInParameter.RBS_PIPING_SYSTEM_TYPE_PARAM);
if (pm != null)
{
MEPSystemType p = m_Document.GetElement(pm.AsElementId()) as MEPSystemType;
if (p != null)
{
Parameter mtrid = p.get_Parameter(BuiltInParameter.MATERIAL_ID_PARAM);
if (mtrid != null)
{
return m_Document.GetElement(mtrid.AsElementId()) as Material;
}
}
}