Issue with listing material assets from custom library
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Re: Inventor forum post - Solved: Odd Material-001, Material-002, Material-003, etc???? - Autodesk Community - Inventor
Getting material asset display names is still an issue when the ActiveMaterialLibrary is a custom user library.
Opening a part file with a custom material library and running the following VBA code results in the printout in the image following the code.
Public Sub LibTest()
Dim lib As AssetLibrary
Set lib = ThisApplication.ActiveMaterialLibrary
For i = 1 To lib.MaterialAssets.Count
Debug.Print i & " " & lib.MaterialAssets(i).DisplayName
Next i
End Sub
Partial debug window
Many of the materials have a "Material-xxx", "MaterialInv-xxx", or "MaterialSim-xxx" display name.
If the user then drops down the Material List in Inventor
And then runs the same macro, the display names have updated to the expected values.
So, what is the process to force this update before extracting the display names? They are obviously materials that are being referenced from the Autodesk and Inventor material libraries.