Message 1 of 5
How to create a table and export it to Excel?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
What is the simplest way to create a table filled with instances of one category and values of several parameters?
So far, I've only managed to collect the elements of a certain category in the collector.
Document doc = commandData.Application.ActiveUIDocument.Document;
FilteredElementCollector collector = new FilteredElementCollector(doc);
BuiltInCategory builtInCategory = BuiltInCategory.OST_Walls;
ElementCategoryFilter elementCategoryFilter = new ElementCategoryFilter(builtInCategory);
IList <Element> allElements = collector.WherePasses(elementCategoryFilter).WhereElementIsNotElementType().ToElements();
List<Parameter> ElemWidthList = new List<Parameter>();
foreach (Element e in AllWalls)
{
ElemWidthList.Add(e.LookupParameter("Width"));
}
PS: I've tried Jeremy's Labs but I couldn't figure out how to find the excel file itself with all the exported elements and also tried CsvHelper but it seems very confusing and the output is just gibberish (image below)