図面内のすべての機器を反復処理して、機器の名前を取得したいと考えています。
ここに私が持っているものがあります:
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' に変換できません
助言がありますか?