Not applicable
11-24-2016
10:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to get a list of the materials that are contained within each wall type. Ideally I would like the names but as a start I am just trying to get the material IDs. I am using the following code (adapted from the Revit Intro Lab 1) where I iterate through the wall types and have a sub-routine to iterate through the materialIds of each WallType. Using this code it seems that the sub-foreach routine is not working and the string p that I create is left unfilled. Any advice would be much appreciated.
FilteredElementCollector wallTypes // 2014 = new FilteredElementCollector(rvtDoc) .OfClass(typeof(WallType)); string s = ""; foreach (WallType wallType in wallTypes) {
string p = ""; foreach (ElementId mat3 in wallType.GetMaterialIds(false)) { p += mat3.ToString() + "\r\n"; } s += wallType.Name + p + "\r\n"; } // Show the result: TaskDialog.Show( "Revit Intro Lab", "Wall Types (in main instruction):\n\n" + s);
Solved! Go to Solution.