Imports System.IO
Imports System.Runtime.InteropServices
Module Example
<STAThread()> _
Sub Main()
Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim strAltLinkPath As String
Dim linksUpdateOptions As SolidEdgeFramework.LinksUpdateOption
Dim documentAccess As SolidEdgeFramework.DocumentAccess
Dim notifyOption As SolidEdgeFramework.NotifyOption
Dim objDocRelationAutoServer As Object = Nothing
Dim strFilePath As String
Dim strFilter As String
Try
OleMessageFilter.Register()
objApplication = Activator.CreateInstance(Type.GetTypeFromProgID("SolidEdge.Application"))
objApplication.Visible = True
linksUpdateOptions = SolidEdgeFramework.LinksUpdateOption.igNoLinksUpdate
strAltLinkPath = String.Empty
documentAccess = SolidEdgeFramework.DocumentAccess.igReadOnly
notifyOption = SolidEdgeFramework.NotifyOption.igNoNotify
strFilter = "Solid Edge Files (*.asm; *.par; *.dft; *.psm; *.pwd), *.asm; *.par; *.dft; *.psm; *.pwd"
strFilter &= ", Assembly Files (*.asm), *.asm"
strFilter &= ", Part Files (*.par), *.par"
strFilter &= ", Draft Files (*.dft), *.dft"
strFilter &= ", Sheet Metal Files (*.psm), *.psm"
strFilter &= ", Weldement Files (*.pwd), *.pwd"
strFilePath = objApplication.GetOpenFileName(linksUpdateOptions, strAltLinkPath, documentAccess, notifyOption, objDocRelationAutoServer, strFilter)
Console.WriteLine(strFilePath)
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
OleMessageFilter.Revoke()
End Try
End Sub
End Module