Revit 二次开发 获取构件的某一层材质

如获取墙的结构材质:混凝土-现场浇筑混凝土

Revit 二次开发 获取构件的某一层材质_第1张图片

//拿到墙材质
WallType wallType = (walls[i] as Wall).WallType;
CompoundStructure wallCS = wallType.GetCompoundStructure();
CompoundStructureLayer wallLayer = wallCS.GetLayers().Where(r => r.Function == MaterialFunctionAssignment.Structure).FirstOrDefault();
ElementId wallMatId = wallLayer.MaterialId;
Material wallMat = doc.GetElement(wallMatId) as Material;

你可能感兴趣的:(学习历程,材质,c#)