Solid Edge Framework Type Library
RenameLibrary Method
Name of existing library as string.
New name of the library as string.
Description
Renames existing library with new name.
Syntax
Visual Basic
Public Sub RenameLibrary( _
   ByVal bstrLibOldName As String, _
   ByVal bstrLibNeName As String _
) 
Parameters
bstrLibOldName
Name of existing library as string.
bstrLibNeName
New name of the library 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"

        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()
            strLibrary = "Materials-DIN"
            Dim strNewMtlLib As String = "Materials-DIN - Modified"

            objMatTable.RenameLibrary(strLibrary, strNewMtlLib)

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

    End Sub

End Class
See Also

MatTable Object  | MatTable Members