Solid Edge Framework Type Library
GetCustomMaterialPropertyFromDoc Method
Specify document (as object) from which you want to get customer material property.
Specify index of the custom material as integer.
Specify name of the custom material as string.
Returns unitType of the custom property.
Returns value of the custom property.
Description
This method will return custom property for input material from specified document.
Syntax
Visual Basic
Public Sub GetCustomMaterialPropertyFromDoc( _
   ByVal pDocument As Object, _
   ByVal nPropIndex As Integer, _
   ByRef bstrPropName As String, _
   ByRef ePropUnitType As UnitTypeConstants, _
   ByRef varPropValue As Variant _
) 
Parameters
pDocument
Specify document (as object) from which you want to get customer material property.
nPropIndex
Specify index of the custom material as integer.
bstrPropName
Specify name of the custom material as string.
ePropUnitType
ValueDescription
igUnitAmountOfSubstanceUnit Type - Amount of Substance
igUnitAngleUnit Type - Angle
igUnitAngularAccelerationUnit Type - Angular Acceleration
igUnitAngularMomentumUnit Type - Angular Momentum
igUnitAngularVelocityUnit Type - Angular Velocity
igUnitAreaUnit Type - Area
igUnitBodyForceUnit Type - Body Force
igUnitCoefficientOfThermalExpansionUnit Type - Coefficient of Thermal Expansion
igUnitDensityUnit Type - Density
igUnitDistanceUnit Type - Distance
igUnitDynamicViscosityUnit Type - Dynamic Viscosity
igUnitElectricalCapacitanceUnit Type - Electrical Capacitance
igUnitElectricalConductanceUnit Type - Electrical Conductance
igUnitElectricalFieldStrengthUnit Type - Electrical Fieldf Strength
igUnitElectricalInductanceUnit Type - Electrical Inductance
igUnitElectricalPotentialUnit Type - Electrical Potential
igUnitElectricalResistanceUnit Type - Electrical Resistance
igUnitElectricChargeUnit Type - Electrical Charge
igUnitEnergyUnit Type - Energy
igUnitEnergyDensityUnit Type - EnergyDensity
igUnitEntropyUnit Type - Entropy
igUnitFilmCoefficientUnit Type - Film Coefficient
igUnitForceUnit Type - Force
igUnitForcePerAreaUnit Type - Force Per Area
igUnitForcePerDistanceUnit Type - Force Per Distance
igUnitFrequencyUnit Type - Frequency
igUnitHeatCapacityUnit Type - Heat Capacity
igUnitHeatFluxPerAreaUnit Type - Heat Flux Per Area
igUnitHeatFluxPerDistanceUnit Type - Heat Flux Per Distance
igUnitHeatGenerationUnit Type - Heat Generation
igUnitHeatSourceUnit Type - Heat Source
igUnitIlluminanceUnit Type - Illuminance
igUnitKinematicViscosityUnit Type - Kinematic Viscosity
igUnitLinearAccelerationUnit Type - Linear Acceleration
igUnitLinearPerAngularUnit Type - Linear Per Angular
igUnitLinearVelocityUnit Type - Linear Velocity
igUnitLuminousFluxUnit Type - Luminous Flux
igUnitLuminousIntensityUnit Type - Luminous Intensity
igUnitMagneticFieldStrengthUnit Type - Magnetic Field Strength
igUnitMagneticFluxUnit Type - Magnetic Flux
igUnitMagneticFluxDensityUnit Type - Magnetic Flux Density
igUnitMassUnit Type - Mass
igUnitMassFlowRateUnit Type - Mass Flow Rate
igUnitMassMomentOfInertiaUnit Type - Mass Moment of Inertia
igUnitMassPerAreaUnit Type - Mass Per Area
igUnitMassPerLengthUnit Type - Mass Per Length
igUnitMomentumUnit Type - Momentum
igUnitPerDistanceUnit Type - Per Distance
igUnitPowerUnit Type - Power
igUnitPressureUnit Type - Pressure
igUnitQuantityOfElectricityUnit Type - Quantity of Electricity
igUnitRadiantIntensityUnit Type - Radiant Intensity
igUnitRotationalStiffnessUnit Type - Rotation Stiffness
igUnitScalarUnit Type - Scalar
igUnitSecondMomentOfAreaUnit Type - Second Moment of Area
igUnitSolidAngleUnit Type - Solid Angle
igUnitTemperatureUnit Type - Temperature
igUnitTemperatureGradientUnit Type - Temperature Gradient
igUnitThermalConductivityUnit Type - Thermal Conductivity
igUnitTimeUnit Type - Time
igUnitTorqueUnit Type - Torque
igUnitVolumeUnit Type - Volume
igUnitVolumeFlowRateUnit Type - Volume Flow Rate
Returns unitType of the custom property.
varPropValue
Returns value of the custom property.
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 strMessage As String
        Dim varGetPropVal As Object = Nothing
        Dim nUnitType As SolidEdgeFramework.UnitTypeConstants = 0
        Dim strPropName 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
            ' Get material table object handle
            objMatTable = objApp.GetMaterialTable()
            objDocument = objApp.Documents.Add("SolidEdge.Partdocument")
            strMaterial = "Steel"
            objMatTable.AddCustomProperty(strMaterial, strLibrary, "My Custom Property ", 1, 152.66)

            objMatTable.AddCustomProperty(strMaterial, strLibrary, "SE Custom Property ", 13, 42.98)

            objMatTable.ApplyMaterialToDoc(objDocument, strMaterial, strLibrary)

            objMatTable.GetCustomMaterialPropertyFromDoc(objDocument, 1, strPropName, nUnitType, varGetPropVal)

            strMessage = String.Format("Custom Property of STEEL - Name: {0}, Unit Type: {1}, Value: {2}", strPropName, nUnitType, varGetPropVal)
            MsgBox(strMessage)

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

    End Sub

End Class
See Also

MatTable Object  | MatTable Members