Revit二次开辟添加、取得墙核心边界系统

原创
小哥 3年前 (2022-11-16) 阅读数 34 #大杂烩
//创建结构层(厚度、功能、材质)
IList layers = new List();
//创建一条核心边界
CompoundStructureLayer layerSurfaceThickness = new CompoundStructureLayer(thickness, MaterialFunctionAssignment.Finish1, ElementId.InvalidElementId);//最后一个参数为材质,如果不填充任何材质则传ElementId.InvalidElementId,有材质则传具体的材质Id
layers.Add(layerSurfaceThickness);
//获取当前墙类型的所有核心边界信息
CompoundStructureLayer cs = (wallType as WallType).GetCompoundStructure();
//把新的核心边界信息,添加到cs中
cs.SetLayers(layers);
//最后把类型的核心边界重新Set
(wallType as WallType).SetCompoundStructure(cs);

//获取强类型中核心边界中,面层1的厚度值(MaterialFunctionAssignment枚举中还有很多类型)
List wall_StructureLayer = wall.WallType.GetCompoundStructure().GetLayers().Where(r => r.Function == MaterialFunctionAssignment.Finish1).ToList();

double surfaceLayer_Width = 0;
if(wall_StructureLayer.Count > 0)
    surfaceLayer_Width = wall_StructureLayer.First().Width;
版权声明

所有资源都来源于爬虫采集,如有侵权请联系我们,我们将立即删除

热门