Solid Edge Framework Type Library
GetPSMGaugeInfoForDoc Method
Specify sheet metal document.
Returns current Gage.
Returns path of Gage file.
Returns number of Materials using excel.
Returns Material Gage Table name.
Returns number of documents using excel.
Returns document Gage table name.
Returns count of Bend Radius value.
Returns count of Bend Angle Value.
Returns count of Bend Natural factor Value.
Description
This API is used to get all the gage related information from a sheet metal document.
Syntax
Visual Basic
Public Sub GetPSMGaugeInfoForDoc( _
   ByVal pDocument As Object, _
   ByRef bstrGageName As String, _
   ByRef bstrGageFilePath As String, _
   ByRef iMTLUsingExcel As Integer, _
   ByRef bstrMTLGageTableName As String, _
   ByRef iDocUsingExcel As Integer, _
   ByRef bstrDocGageTableName As String, _
   ByRef iCountBendRadiusVals As Integer, _
   ByRef iCountBendAngleVals As Integer, _
   ByRef iCountNFVals As Integer _
) 
Parameters
pDocument
Specify sheet metal document.
bstrGageName
Returns current Gage.
bstrGageFilePath
Returns path of Gage file.
iMTLUsingExcel
Returns number of Materials using excel.
bstrMTLGageTableName
Returns Material Gage Table name.
iDocUsingExcel
Returns number of documents using excel.
bstrDocGageTableName
Returns document Gage table name.
iCountBendRadiusVals
Returns count of Bend Radius value.
iCountBendAngleVals
Returns count of Bend Angle Value.
iCountNFVals
Returns count of Bend Natural factor Value.
Example
Imports System.Runtime.InteropServices

Public Class Form1

    Private Sub GetPSMGaugeInfoForDoc_Click(sender As Object, e As EventArgs) Handles GetPSMGaugeInfoForDoc.Click
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim objSMDoc As SolidEdgePart.SheetMetalDocument = Nothing
        Dim myMatTable As SolidEdgeFramework.MatTable = Nothing
        Dim strCurrGageName As String = ""
        Dim strGageFilePath As String = ""
        Dim nMTLUsingExcel As Integer
        Dim strMTLGageTableName As String = ""
        Dim nDocUsingExcel As Integer
        Dim strDocGageTableName As String = ""
        Dim nCountBendRadiusVals As Integer
        Dim nCountBendAngleVals As Integer
        Dim nCountNFVals As Integer

        Try

            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.GetPSMGaugeInfoForDoc(objSMDoc,
                                      strCurrGageName,
                                      strGageFilePath,
                                      nMTLUsingExcel,
                                      strMTLGageTableName,
                                      nDocUsingExcel,
                                      strDocGageTableName,
                                      nCountBendRadiusVals,
                                      nCountBendAngleVals,
                                      nCountNFVals)

            MsgBox("Current Gage:  " + strCurrGageName)
            MsgBox("Current Gage File:  " + strGageFilePath)
            MsgBox("Material Using Excel:  " + nMTLUsingExcel.ToString)
            MsgBox("Material Gage Table:  " + strMTLGageTableName)
            MsgBox("Document Using Excel:  " + nDocUsingExcel.ToString)
            MsgBox("Document Gage Table:  " + strDocGageTableName)
            MsgBox("Count Of Bend Radius Values:  " + nCountBendRadiusVals.ToString)
            MsgBox("Count Of Bend Angle Values:  " + nCountBendAngleVals.ToString)
            MsgBox("Count Of Bend Neutral Factor Values:  " + nCountNFVals.ToString)
        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 GetPSMGaugeInfoForDoc_Click(object sender, EventArgs e)
    {
        SolidEdgeFramework.Application objApplication = null;
        SolidEdgePart.SheetMetalDocument objSMDoc = null;
        SolidEdgeFramework.MatTable myMatTable = null;
        string strCurrGageName = "";
        string strGageFilePath = "";
        int nMTLUsingExcel = 0;
        string strMTLGageTableName = "";
        int nDocUsingExcel = 0;
        string strDocGageTableName = "";
        int nCountBendRadiusVals = 0;
        int nCountBendAngleVals = 0;
        int nCountNFVals = 0;

        try
        {

            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.GetPSMGaugeInfoForDoc(objSMDoc, strCurrGageName, strGageFilePath, nMTLUsingExcel, strMTLGageTableName, nDocUsingExcel, strDocGageTableName, nCountBendRadiusVals, nCountBendAngleVals, nCountNFVals);

            MessageBox.Show("Current Gage:  " + strCurrGageName);
            MessageBox.Show("Current Gage File:  " + strGageFilePath);
            MessageBox.Show("Material Using Excel:  " + nMTLUsingExcel.ToString());
            MessageBox.Show("Material Gage Table:  " + strMTLGageTableName);
            MessageBox.Show("Document Using Excel:  " + nDocUsingExcel.ToString());
            MessageBox.Show("Document Gage Table:  " + strDocGageTableName);
            MessageBox.Show("Count Of Bend Radius Values:  " + nCountBendRadiusVals.ToString());
            MessageBox.Show("Count Of Bend Angle Values:  " + nCountBendAngleVals.ToString());
            MessageBox.Show("Count Of Bend Neutral Factor Values:  " + nCountNFVals.ToString());
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }
    }
}
See Also

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