我想遍历绘图中的所有设备并获取设备的名称。
这是我所拥有的:
UIApplication uiapp = commandData.Application;
UIDocument uidoc = uiapp.ActiveUIDocument;
Application app = uiapp.Application;
Document doc = uidoc.Document;
// get all PanelScheduleView instances in the Revit document.
FilteredElementCollector fec = new FilteredElementCollector(doc);
ElementClassFilter EquipmentViewsAreWanted =
new ElementClassFilter(typeof(ElectricalEquipment));
fec.WherePasses(EquipmentViewsAreWanted);
List<Element> eViews = fec.ToElements() as List<Element>;
StringBuilder Disp = new StringBuilder();
foreach (ElectricalEquipment element in eViews)
{
Disp.Append("\n" + element.);
}
System.Windows.Forms.MessageBox.Show(Disp.ToString());
foreach
我在循环中收到以下错误:
无法将类型“Autodesk.Revit.DB.Element”转换为“Autodesk.Revit.DB.Electrical.ElectricalEquipment”
有什么建议么?