Solid Edge Framework Type Library
SetMaterialToGageTableAssociation Method
Sheet metal document.
Name of material as string.
Material Gage Table name as string.
Specify as "True" if you wish to associate material and Gage table else specify "False".
Description
This method is used to create an association between a material and a Gage table.
Syntax
Visual Basic
Public Sub SetMaterialToGageTableAssociation( _
   ByVal pDocument As Object, _
   ByVal bstrMaterialName As String, _
   ByVal bstrMaterialGageTableName As String, _
   ByVal bAddAssociation As Boolean _
) 
Parameters
pDocument
Sheet metal document.
bstrMaterialName
Name of material as string.
bstrMaterialGageTableName
Material Gage Table name as string.
bAddAssociation
Specify as "True" if you wish to associate material and Gage table else specify "False".
Remarks
This method will update the material library, hence user must have write access to the library file "Material.mtl". In order to remove the association that last parameter needs to be passed as False.
Example
Imports System.Runtime.InteropServices

Public Class Form1

    Private Sub SetMaterialToGageTableAssociation_Click(sender As Object, e As EventArgs) Handles SetMaterialToGageTableAssociation.Click
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim objSMDoc As SolidEdgePart.SheetMetalDocument = Nothing
        Dim myMatTable As SolidEdgeFramework.MatTable = Nothing
        Dim strGageFileName As String = ""
        Dim bAddAssociation As Boolean = True

        Dim strInputMaterial As String = "Aluminum, 2024-T4"
        Dim strMtlGageTabelName As String = "aluminium 6061"


        Try
            MsgBox("Adding 'Material to Gage Table' Association!")
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")
            ' Get the material table object from the application
            myMatTable = objApplication.GetMaterialTable()

            objSMDoc = objApplication.ActiveDocument
            If (objSMDoc Is Nothing) Then
                MsgBox("Failed to get Sheet Metal Document object.")
            End If
            Call myMatTable.SetMaterialToGageTableAssociation(objSMDoc, strInputMaterial, strMtlGageTabelName, bAddAssociation)
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub
End Class
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;

public class Form1
{

    private void SetMaterialToGageTableAssociation_Click(object sender, EventArgs e)
    {
        SolidEdgeFramework.Application objApplication = null;
        SolidEdgePart.SheetMetalDocument objSMDoc = null;
        SolidEdgeFramework.MatTable myMatTable = null;
        string strGageFileName = "";
        bool bAddAssociation = true;

        string strInputMaterial = "Aluminum, 2024-T4";
        string strMtlGageTabelName = "aluminium 6061";


        try
        {
            MessageBox.Show("Adding 'Material to Gage Table' Association!");
            objApplication = (SolidEdgeFramework.Application)Marshal.GetActiveObject("SolidEdge.Application");
            // Get the material table object from the application
            myMatTable = objApplication.GetMaterialTable();

            objSMDoc = objApplication.ActiveDocument;
            if (objSMDoc == null)
            {
                MessageBox.Show("Failed to get Sheet Metal Document object.");
            }
            myMatTable.SetMaterialToGageTableAssociation(objSMDoc, strInputMaterial, strMtlGageTabelName, bAddAssociation);
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }
    }
}
See Also

MatTable Object  | MatTable Members