Imports System.Runtime.InteropServices
Public Class Form1
'#region GetPSMGaugeListFromExcel
Private Sub GetPSMGaugeListFromExcel_Click(sender As Object, e As EventArgs) Handles GetPSMGaugeListFromExcel.Click
Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objSMDoc As SolidEdgePart.SheetMetalDocument = Nothing
Dim myMatTable As SolidEdgeFramework.MatTable = Nothing
Dim objGageList As Object = Nothing
Dim nNumofGages As Integer
Dim strInputgageTable As String = "Stainless Steel"
Try
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
' Get the material table object from the application
myMatTable = objApplication.GetMaterialTable()
objSMDoc = objApplication.Documents.Add("SolidEdge.SheetMetalDocument")
Call myMatTable.GetPSMGaugeListFromExcel(strInputgageTable, nNumofGages, objGageList)
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
{
//#region GetPSMGaugeListFromExcel
private void GetPSMGaugeListFromExcel_Click(object sender, EventArgs e)
{
SolidEdgeFramework.Application objApplication = null;
SolidEdgePart.SheetMetalDocument objSMDoc = null;
SolidEdgeFramework.MatTable myMatTable = null;
object objGageList = null;
int nNumofGages = 0;
string strInputgageTable = "Stainless Steel";
try
{
objApplication = (SolidEdgeFramework.Application)Marshal.GetActiveObject("SolidEdge.Application");
// Get the material table object from the application
myMatTable = objApplication.GetMaterialTable();
objSMDoc = objApplication.Documents.Add("SolidEdge.SheetMetalDocument");
myMatTable.GetPSMGaugeListFromExcel(strInputgageTable, nNumofGages, objGageList);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}