使用ThreeJs搭建BIM模型瀏覽器-Revit篇-構件顏色

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;
                    }
                }
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章