- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to read the content of AppearanceAssetElement instances for a given material. I am following the instructions give in Boris Shafiro AU presentation about Schemas (https://www.autodesk.com/autodesk-university/class/New-API-Modify-Visual-Appearance-Materials-Revit-...) and I have a few questions, I get the asset like this:
ElementId appearanceAssetId = material.AppearanceAssetId;
var appearanceAssetElem = document.GetElement(appearanceAssetId) as AppearanceAssetElement;
Asset asset = appearanceAssetElem.GetRenderingAsset();
First question. What's the appropriate way to get the schema of an asset? I can "guess" the schema by looking at asset.Name. That gives me something like "CeramicSchema" which I assume means this asset belongs to Autodesk.Revit.DB.Visual.Ceramic schema, but is there an enum or static field that would be more reliable?
So now I can get the properties like this:
AssetProperty certamicPattern = asset[Ceramic.CeramicPattern];
but that wouldn't capture all the asset properties, in fact, with this strategy I would lose more than half of the asset properties. Some of them are from the SchemaCommon, but then there are some that I am not quite sure which (if any) schema they belong to, these are a few names that I get when simply iterating over all the asset properties:
- AdvancedUIDefinition
- AssetLibID
- ExchangeGUID
- ImplementationGeneric
- ...
Should I simply Ignore everything that doesn't fit into SchemaCommon or Ceramic schema? Is there a schema somewhere that I am missing?
Thank you so much for the help!
Solved! Go to Solution.