I'm looking to retrieve in the form of a list via VBA in a combobox the list of existing Solidworks materials (Sldmat file).
This is in order to select the right material from this list and fill in a configuration. I create a personalized userbox that would best meet all my needs, which is unfortunately not the case with the standard Solidworks tool.
I have carried out several tests following the information from Solidworks but nothing is conclusive.
If someone has a code that works (SW2015), I 'm a taker.
I have been able to extract the list of favorite materials but not from the API. It is stored in the registry for each individual user. You need to use wsHost.RegRead to get all the entries. Take a look at this key:
That being said, I think you are on a better track to use a specific custom materials file, since that can be set up with a common list for everyone, while each user's favorites will differ.