该类表示Revit中的结构分析模型,用于定义概念构造楼板类型。
Name
Thickness
MassPerArea
IsStructural
MaterialName
Equals(Object)
GetHashCode()
GetType()
ToString()
//创建楼板类型
ConceptualConstructionFloorSlabType slabType = new ConceptualConstructionFloorSlabType();
slabType.Name = "Concrete Floor";
slabType.Thickness = 100;
slabType.IsStructural = true;
slabType.MassPerArea = 1500;
slabType.MaterialName = "Concrete";
//将楼板类型应用于构造楼板
Document doc = commandData.Application.ActiveUIDocument.Document;
using (Transaction trans = new Transaction(doc, "Set Conceptual Construction Floor Slab Type"))
{
trans.Start();
//获取当前视图的选择集
Selection sel = commandData.Application.ActiveUIDocument.Selection;
//获取所有选中的构造楼板
IList<ElementId> floorIds = sel.GetElementIds().Where(id => doc.GetElement(id) is Floor).ToList();
//为每个构造楼板设置楼板类型
foreach (ElementId floorId in floorIds)
{
Floor floor = doc.GetElement(floorId) as Floor;
if (floor != null && floor.FloorType.CanHaveConceptualConstruction)
{
floor.FloorType.ConceptualConstruction = slabType;
}
}
trans.Commit();
}