Solid Edge Framework Type Library
RenameMaterial Method
Specify existing material name as string.
Specify name of the library in which the material is available.
Specify new material name as string.
Description
Renames the input material with new name.
Syntax
Visual Basic
Public Sub RenameMaterial( _
   ByVal bstrMatOldName As String, _
   ByVal bstrLibname As String, _
   ByVal bstrMatNewName As String _
) 
Parameters
bstrMatOldName
Specify existing material name as string.
bstrLibname
Specify name of the library in which the material is available.
bstrMatNewName
Specify new material name as string.
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 strMaterial 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()
            strMaterial = "Aluminum, 7075-T6"
            Dim strNewMtlName As String = "Aluminum, 7075-T6 - Modified"

            objMatTable.RenameMaterial(strMaterial, strLibrary, strNewMtlName)


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

    End Sub

End Class
See Also

MatTable Object  | MatTable Members