
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm working with the Revit 2015-2018 APIs, and this problem manifests itself with all versions.
Within my plugin, I'm getting a Material, AppearanceAsset and then the Asset itself to determine the appearance properties thus :-
Material material = document.GetElement(materialid) as Material;
AppearanceAssetElement appearance = document.GetElement(material.AppearanceAssetId) as AppearanceAssetElement;
Asset asset = appearanceElem.GetRenderingAsset();
However, for some Materials, the AppearanceAssetId is set to {-1}, so effectively there is no AppearanceAssetElement or Asset to fetch, as per the MaterialDebug.png
But, when I open the Materials Panel in Revit, the Material clearly has an Appearance Asset & Assets defined, as per the MaterialPanel.png.
Is this a bug in the API, or is there some other mechanism by which a Material and Appearance Asset are linked together?
This makes absolutely no sense to me. It only manifests itself for certain materials, but behaves consistently across multiple trials.
Solved! Go to Solution.