Material Assets Collector: Appearance, Structural (Physical) & Thermal

Not applicable
07-26-2017
03:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We are trying to gather all the material assets loaded into a project file, but ran into a roadblock. We can successfully do this for the appearance assets, but for the other assets the approach does not work.
The only way that we can gather the structural and thermal assets is by starting with materials and cycle through the assets that are assigned. This approach will omit assets that are not assigned to materials.
Please see C# code below for reference. Any insight into how this can be achieved will be much appreciated.
FilteredElementCollector collector = new FilteredElementCollector(doc);
//code works for appearance assets ICollection<Element> appearanceAssets = collector.OfClass(typeof(AppearanceAssetElement)).ToElements();
//code throws an error ICollection<Element> physicalAssets = collector.OfClass(typeof(StructuralAssetClass)).ToElements();
//code throws an error ICollection<Element> physicalAssets2 = collector.OfClass(typeof(StructuralAsset)).ToElements();
//code returns zero elements ICollection<Element> propertySet = collector.OfClass(typeof(PropertySetElement)).ToElements();
//code throws an error ICollection<Element> thermalAssets = collector.OfClass(typeof(ThermalAsset)).ToElements();
Error:
Autodesk.Revit.Exceptions.ArgumentException: Input type(Autodesk.Revit.DB.StructuralAssetClass) is not a recognized Revit API type