Imports System.Runtime.InteropServices
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim objApplication As SolidEdgeFramework.Application
Dim ObjSEEC As SolidEdgeFramework.SolidEdgeTCE = Nothing
Dim ObjDoc As SolidEdgeFramework.SolidEdgeDocument = Nothing
Dim ListOfPropsForFileSaveAs(3, 1) As Object
Dim oldFileName As String
Dim newFileName As Object = Nothing
Dim App_Path As String
Try
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
ObjSEEC = objApplication.SolidEdgeTCE
App_Path = New System.IO.FileInfo(Application.ExecutablePath).DirectoryName
oldFileName = App_Path + "\Part1.par"
newFileName = ""
ListOfPropsForFileSaveAs(0, 0) = "Item ID"
ListOfPropsForFileSaveAs(0, 1) = "000464"
ListOfPropsForFileSaveAs(1, 0) = "Revision"
ListOfPropsForFileSaveAs(1, 1) = "A"
ListOfPropsForFileSaveAs(2, 0) = "Item Name"
ListOfPropsForFileSaveAs(2, 1) = "000464 - A"
ListOfPropsForFileSaveAs(3, 0) = "Dataset Name"
ListOfPropsForFileSaveAs(3, 1) = "000464/A"
Call ObjSEEC.SetPDMProperties(oldFileName, ListOfPropsForFileSaveAs, newFileName)
ObjDoc = objApplication.Documents.Open(oldFileName)
ObjDoc.SaveAs(newFileName)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class