Revit墙体构造层修改与查询
一直想用博客记录下自己的一些问题和解决方案,今天是在CSDN上的第一篇博客,其余的会陆续从知乎转移过来
参考链接:https://blog.csdn.net/u010585773/article/details/83267911
在Revit中如果对墙体厚度进行数据查询,只需要访问WallType就可以,在修改相应的厚度是需要进入构造层:CompoundStructure 类似与我们使用中的新建厚度面板。里面提供了创建和修改构造层图层的方法
WallType type = WallTypes.ElementAt(0) as WallType;
WallType newType = type.Duplicate(name) as WallType;
//墙厚
CompoundStructure cs = type.GetCompoundStructure();
CompoundStructure wallComPound = newType.GetCompoundStructure();
foreach (CompoundStructureLayer layer in wallComPound.GetLayers())
{
layer.Width = value / 304.8;
wallComPound.SetLayerWidth(layer.LayerId, layer.Width);
break;
}
newType.SetCompoundStructure(wallComPound);
修改厚度之后需要将值传回到构造层,让WallType的构造层参数改变。