Working with part materials using SOLIDWORKS API
Material database in SOLIDWORKS is stored within the XML file. SOLIDWORKS API doesn't provide any direct methods of working with materials database (i.e. searching, adding, reading etc.). However as XML is an open format any XML parsing techniques would apply, i.e. using the XmlDocument, XmlSerializer etc.
ISldWorks::GetMaterialDatabases SOLIDWORKS API method returns the paths to material databases.
IPartDoc::GetMaterialPropertyName2 returns the name of the material and the name of the database this material is stored in.
This section contains examples explaining how to work with the materials database in SOLIDWORKS, how to apply and read material information from SOLIDWOKS parts and bodies.