Message 1 of 2

Not applicable
08-16-2021
01:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to create a new material and set it appearance properties (in particular it's color).
I have tried to find and existing appearance asset and use it to create my own copy. However, when I loop over all materials using the following code:
var materials = new FilteredElementCollector(modelDocument)
.OfClass(typeof(Material))
.ToElements()
.Cast < Material > ().ToList();
and check the AppearanceAssetId property, I see that for all materials it's set to -1 (including all the default materials).
How can I retrieve a valid asset to create my own instance?
Solved! Go to Solution.