Solid Edge Framework Type Library
AddCustomProperty Method
Specify material name as string.
Specify material library name as string.
Specify NEW property name as string.
Specify property type for NEW property.
Specify value for NEW property.
Description
Adds the custom property for input material.
Syntax
Visual Basic
Public Sub AddCustomProperty( _
   ByVal bstrMatName As String, _
   ByVal bstrMatLibName As String, _
   ByVal bstrPropName As String, _
   ByVal ePropUnitType As UnitTypeConstants, _
   ByVal varPropValue As Variant _
) 
Parameters
bstrMatName
Specify material name as string.
bstrMatLibName
Specify material library name as string.
bstrPropName
Specify NEW property name 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
Specify property type for NEW property.
varPropValue
Specify value for NEW property.
Example
Imports System
Imports System.Runtime.InteropServices

Namespace Examples
    Friend Class Program
        <STAThread>
        Shared Sub Main(ByVal args() As String)
            Dim application As SolidEdgeFramework.Application = Nothing
            Dim materialTable As SolidEdgeFramework.MatTable = Nothing

            Try
                ' See "Handling 'Application is Busy' and 'Call was Rejected By Callee' errors" topic.
                OleMessageFilter.Register()

                ' Attempt to connect to a running instance of Solid Edge.
                application = DirectCast(Marshal.GetActiveObject("SolidEdge.Application"), SolidEdgeFramework.Application)
                materialTable = application.GetMaterialTable()

                Dim materialName = "Steel"
                Dim libraryName = "Materials"
                materialTable.AddCustomProperty(materialName, libraryName, "My custom property", SolidEdgeFramework.UnitTypeConstants.igUnitDistance, 152.66)
            Catch ex As System.Exception
                Console.WriteLine(ex)
            Finally
                OleMessageFilter.Unregister()
            End Try
        End Sub
    End Class
End Namespace
using System;
using System.Runtime.InteropServices;

namespace Examples
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            SolidEdgeFramework.Application application = null;
            SolidEdgeFramework.MatTable materialTable = null;

            try
            {
                // See "Handling 'Application is Busy' and 'Call was Rejected By Callee' errors" topic.
                OleMessageFilter.Register();

                // Attempt to connect to a running instance of Solid Edge.
                application = (SolidEdgeFramework.Application)Marshal.GetActiveObject("SolidEdge.Application");
                materialTable = application.GetMaterialTable();

                var materialName = "Steel";
                var libraryName = "Materials";
                materialTable.AddCustomProperty(materialName, libraryName, "My custom property", SolidEdgeFramework.UnitTypeConstants.igUnitDistance, 152.66);
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(ex);
            }
            finally
            {
                OleMessageFilter.Unregister();
            }
        }
    }
}
See Also

MatTable Object  | MatTable Members