Solid Edge Framework Type Library
GetCountOfCustomProperties Method
Specify name of material as string.
Specify name of the library as string.
Returns the number of properties as integer.
Description
Returns the count of custom properties of a material from specified library.
Syntax
Visual Basic
Public Sub GetCountOfCustomProperties( _
   ByVal bstrMatName As String, _
   ByVal bstrMatLibName As String, _
   ByRef nNumOfCustProps As Integer _
) 
Parameters
bstrMatName
Specify name of material as string.
bstrMatLibName
Specify name of the library as string.
nNumOfCustProps
Returns the number of properties as integer.
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 nNumOfCustProps As Integer
        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 = "Steel"
            objMatTable.GetCountOfCustomProperties(strMaterial, strLibrary, nNumOfCustProps)

            strMessage = String.Format("Steel has {0} custom Properties", nNumOfCustProps)
            MsgBox(strMessage)



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

    End Sub

End Class
See Also

MatTable Object  | MatTable Members