c# - 为 WallType 设置新的复合结构不会更新 CompoundStructureLayers 的 LayerID
问题描述
1)我有一个WallType,需要改变WallType的复合结构。
private void updateCompoundStructure(WallType wT)
{
IList<Autodesk.Revit.DB.CompoundStructureLayer> csl = new List<Autodesk.Revit.DB.CompoundStructureLayer>();
csl.Add(new Autodesk.Revit.DB.CompoundStructureLayer()
{
DeckEmbeddingType = deck,
DeckProfileId = profileId,
Function = structureFunction,
LayerCapFlag = item.LayerCapFlag,
MaterialId = materialId,
Width = item.Thickness
});
CompoundStructure cs = CompoundStructure.CreateSimpleCompoundStructure(csl);
if (cs.IsValid(dbDoc, out IDictionary<int, CompoundStructureError> errMap, out IDictionary<int, int> twoLayerErrorMap))
{
wallType.SetCompoundStructure(cs);
}
}
墙型复合结构正确更新
但是,CompoundStructureLayer.LayerId 是只读字段,我们无法为我得到的所有 CompoundStructureLayer 的 LayerId 更新它,就像 0
2)当我阅读复合结构形式的 WallType 时,它在第 0 个索引处给出 LayerID 为 0,
在第一个索引为 1
在第二个索引为 2... 等等
有没有办法更新复合结构的layerID?是否有任何解决方法可以实现这一目标。
解决方案
推荐阅读
- javascript - 如何隐藏属于锚点的 i 元素
- python - 如何在 python 中提高图像的分辨率 - 一种可能的解决方案?
- android - 如何在 MainActivity 类中调用非活动类?
- ruby - 使用 Thin 作为简单 rhtml 服务器的简单 Ruby 服务器设置(如 Webrick)
- javascript - 更新时停止文本“抖动”
- java - 缺少 JavaFX 运行时组件,需要在 powershell 中为 openjfx 11 运行此应用程序
- php - PHP注入未在文本框中显示回声
- wordpress - 如何在 WordPress 表单联系表单 7 之间传递表单数据
- django - X-Accel-Redirect 功能不适用于外部连接(在 docker 网络内)
- java - 在改造中请求多部分图像上传以及其他请求属性?