Solid Edge Framework Type Library
AddMaterial Method
New material name.
Number of properties for this material.
Array containing list of various material properties.
Face style for new material.
Fill style for new material.
Rendering style for new material.
Description
Adds material to material library.
Syntax
Visual Basic
Public Sub AddMaterial( _
   ByVal bstrMatName As String, _
   ByVal lNumProps As Long, _
   ByVal varPropList As Variant, _
   ByVal bstrFaceStyle As String, _
   ByVal bstrFillStyle As String, _
   ByVal bstrVSPlusStyle As String _
) 
Parameters
bstrMatName
New material name.
lNumProps
Number of properties for this material.
varPropList
Array containing list of various material properties.
bstrFaceStyle
Face style for new material.
bstrFillStyle
Fill style for new material.
bstrVSPlusStyle
Rendering style for new material.
Remarks
This is a defunct API. From ST7 onwards, this API will will work only when there is single library. Hence it's recommended to use "AddMaterialToLibrary" API which can be used on a specific library when you have multiple libraries.
Example
Imports System.Runtime.InteropServices
Public Class Form1


    Private Sub AddMaterial_Click(sender As Object, e As EventArgs) Handles AddMaterial.Click
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim objPartDocument As SolidEdgePart.PartDocument = Nothing
        Dim matTable As SolidEdgeFramework.MatTable = Nothing

        Dim aMaterials As Object = Nothing
        Dim sMatName As String = "Test"
        Dim sFaceStyle As String = "Pearl"
        Dim sFillStyle As String = "Normal"
        Dim sVSStyle As String = "RenderingMtrl"
        Dim aMatProps(10) As Long
        Dim i As Integer

        Try
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")
            objPartDocument = objApplication.ActiveDocument
            matTable = objApplication.GetMaterialTable

            'Get the list of all the materials in the material library file
            matTable.GetMaterialList(i, aMaterials)

            'Set the active document
            matTable.SetActiveDocument(objPartDocument)

            'Add a new material
            matTable.AddMaterial(sMatName, 10, aMatProps, sFaceStyle, sFillStyle, sVSStyle)

            'Apply a material
            matTable.ApplyMaterial(objPartDocument, sMatName)

            'Delete a material
            matTable.DeleteMaterial(sMatName)


        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub
End Class
See Also

MatTable Object  | MatTable Members  | Solid Edge V17 - What's New