10-21-2022
09:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-21-2022
09:00 AM
Here's what I found:
Comparison with library:
For materials within each model state: `oDoc.ComponentDefinition.ModelStates`, `.Activate` each and get `mat = oDoc.ActiveMaterial`
For selecting the library to compare against: `library = ThisApplication.AssetLibraries(libraryName)` and instead of trying to find the origin, just `try`ing to change with `library(mat.DisplayName)` and defaulting to something else if not found.
Purging unused:
For locally stored materials: `ThisDoc.Document.MaterialAssets` and `.Delete` each where `Not` `.IsUsed` (this only keeps the currently active model state's material, but the others are added back on each activation respectively)