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

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

cs 复制代码
//拿到墙材质
WallType wallType = (walls[i] as Wall).WallType;
CompoundStructure wallCS = wallType.GetCompoundStructure();
CompoundStructureLayer wallLayer = wallCS.GetLayers().Where(r => r.Function == MaterialFunctionAssignment.Structure).FirstOrDefault<CompoundStructureLayer>();
ElementId wallMatId = wallLayer.MaterialId;
Material wallMat = doc.GetElement(wallMatId) as Material;
相关推荐
ytttr873几秒前
C# 读取数据库表结构工具设计与实现
开发语言·数据库·c#
鸽子一号28 分钟前
c#笔记之lambda表达式和linq
笔记·c#·linq
qq_391105342 小时前
TDengine C# 连接示例和授权管理
大数据·数据库·c#·时序数据库·tdengine
a17798877122 小时前
小程序码的生成与获取码中的scene
小程序·c#
无风听海3 小时前
.NET10之C# Target-typed new expression深入解析
windows·c#·.net
这辈子谁会真的心疼你3 小时前
怎么修改pdf文档属性?介绍三个方法
数据库·pdf·c#
初九之潜龙勿用18 小时前
C# 解决“因为算法不同,客户端和服务器无法通信”的问题
服务器·开发语言·网络协议·网络安全·c#
net3m3321 小时前
C#插件化架构(Plugin Architecture)或 可插拔架构,根据产品类型编码的不同自动路由到目标函数,而无需为每个产品都编码相应的代码!!
重构·c#
水深00安东尼1 天前
C#猜数字小游戏
开发语言·c#
无风听海1 天前
.NET10之C# Extension Members深入分析
大数据·c#·.net·extensionmember