Solid Edge Framework Type Library
SetMaterialPropValueToLibrary Method
Specify name of the material as string.
Specify name of the library as string.
Description
Sets the value for property of a material from specified library.
Syntax
Visual Basic
Public Sub SetMaterialPropValueToLibrary( _
   ByVal bstrMatName As String, _
   ByVal bstrLibraryName As String, _
   ByVal lPropIndex As MatTablePropIndexConstants, _
   ByVal varPropValue As Variant _
) 
Parameters
bstrMatName
Specify name of the material as string.
bstrLibraryName
Specify name of the library as string.
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
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
        Dim iMatPropIndex As SolidEdgeConstants.MatTablePropIndexConstants
        Dim varGetPropVal As Object = Nothing

        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

            ' Get material table object handle
            objMatTable = objApp.GetMaterialTable()
            strMaterial = "Galvanized steel"
            iMatPropIndex = SolidEdgeConstants.MatTablePropIndexConstants.seYieldStress
            varGetPropVal = 225000000.56
            objMatTable.SetMaterialPropValueToLibrary(strMaterial, strLibrary, iMatPropIndex, varGetPropVal)

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

    End Sub

End Class
See Also

MatTable Object  | MatTable Members