Autodesk.Revit.DB.Electrical.ElectricalLoadType类提供了电气负载类型的属性和方法。它表示一个特定的电气负载类型,如照明、插座或设备,用于在Revit中表示电气系统的建模。
// 获取所有的电气负载类型
FilteredElementCollector collector = new FilteredElementCollector(doc);
ICollection<Element> electricalLoadTypes = collector.OfClass(typeof(ElectricalLoadType)).ToElements();
// 遍历所有的电气负载类型
foreach (Element ele in electricalLoadTypes)
{
ElectricalLoadType loadType = ele as ElectricalLoadType;
// 获取电气负载类型的属性
string name = loadType.Name;
string familyName = loadType.FamilyName;
ElectricalLoadTypeKind kind = loadType.LoadTypeKind;
// 输出电气负载类型的属性
TaskDialog.Show("Load Type Info", "Name: " + name + "\nFamily Name: " + familyName + "\nKind: " + kind.ToString());
}