UIApplication App=this.ActiveUIDocument.Application;
Autodesk.Revit.DB.Document doc = App.ActiveUIDocument.Document;
Autodesk.Revit.UI.UIDocument uidoc = App.ActiveUIDocument;
string nameSchedule="Спецификация";
FilteredElementCollector collectorEqipments = new FilteredElementCollector(doc).WhereElementIsNotElementType().OfClass(typeof(ViewSchedule));
Element finded = collectorEqipments.ToList().Find(x => x.Name.Contains(nameSchedule));
if (finded != null)
{
ViewSchedule sch=finded as ViewSchedule;
if(sch!=null)
{
TableData colTableData = sch.GetTableData();
TableSectionData tsd = colTableData.GetSectionData(SectionType.Body);
var rowCount = tsd.NumberOfRows;
var colCount = tsd.NumberOfColumns;
string data=string.Empty;
for (int i = 0; i < rowCount; i++)
{
for (int j = 0; j < colCount; j++)
{
data =data+" "+sch.GetCellText(SectionType.Body, i, j);
}
data =data+Environment.NewLine;
}
TaskDialog.Show("инфо", data);
}
}