Message 1 of 4

Not applicable
10-12-2018
06:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi folks,
I would like to be able to get the materials in the project and get their Material Class.
The code I've written is as follows.
FilteredElementCollector materials = new FilteredElementCollector(Global.doc()).OfClass(typeof(Material)); List<Element> materialList = materials.ToList();
But when I try to get i.e materialList[11].MaterialClass I am not able to retrieve its class. Eventhough I know its there.
There must be a specific way of casting the value.
I've tried casting like (Autodesk.Revit.DB.Material)materialList[11] but it didn't helped either.
Can anybody please help me to retrive MaterialClass please. Any advice is much appreciated.
Solved! Go to Solution.