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