Solid Edge Framework Type Library
GetMaterialPropValueFromDoc Method
Specify document object.
Returns property of the material which is applied to the document.
Description
Return Material's property from input document.
Syntax
Visual Basic
Public Sub GetMaterialPropValueFromDoc( _
   ByVal pDocument As Object, _
   ByVal lPropIndex As MatTablePropIndexConstants, _
   ByRef varPropValue As Variant _
) 
Parameters
pDocument
Specify document object.
lPropIndex
ValueDescription
seCoefOfThermalExpansionCoef. of Thermal Expansion
seDensityDensity
seElongationElongation
seFaceStyleFace Style
seFillStyleFill Style
seMaterialNameMaterial Name
seModulusElasticityModulus of Elasticity
sePoissonRatioPoisson Ratio
seSpecificHeatSpecific Heat
seThermalConductivityThermal Conductivity
seUltimateStressUltimate Stress
seVSPlusStyleVSPlus Style
seYieldStressYield Stress
varPropValue
Returns property of the material which is applied to the document.
Remarks
This method returns the property values of the material which is already applied to document.
Example
Imports System.Runtime.InteropServices

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim objApp As SolidEdgeFramework.Application = Nothing
        Dim objType As Type = Nothing
        Dim objMatTable As SolidEdgeFramework.MatTable = Nothing
        Dim strLibrary As String = "Materials"
        Dim objDocument As SolidEdgePart.PartDocument = Nothing
        Dim strMaterial As String = "Copper"
        Dim iMatPropIndex As SolidEdgeConstants.MatTablePropIndexConstants
        Dim varGetPropVal As Object = Nothing
        Dim strMessage As String

        Try
            ' Get SE handle
            objApp = Marshal.GetActiveObject("SolidEdge.Application")

            If objApp Is Nothing Then
                ' Get the type from the Solid Edge ProgID
                objType = Type.GetTypeFromProgID("SolidEdge.Application")
                ' Start Solid Edge
                objApp = Activator.CreateInstance(objType)
                ' Make Solid Edge visible
                objApp.Visible = True
            End If
            objDocument = objApp.Documents.Add("SolidEdge.PartDocument")
            
            ' Get material table object handle
            objMatTable = objApp.GetMaterialTable()

            ' Set active document handle
            objMatTable.SetActiveDocument(objDocument)
            strMaterial = "ABS Plastic, high impact"
            objMatTable.ApplyMaterialToDoc(objDocument, strMaterial, strLibrary)

            iMatPropIndex = SolidEdgeConstants.MatTablePropIndexConstants.seMaterialName
            objMatTable.GetMaterialPropValueFromDoc(objDocument, iMatPropIndex, varGetPropVal)
            strMessage = String.Format("Material Name = {0}", varGetPropVal.ToString())
            MsgBox(strMessage)

        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try

    End Sub

End Class
See Also

MatTable Object  | MatTable Members