본문 바로가기
  • Welcome!
VBA For Creo

#3 IpfcSession - UI로 작업 공간을 선택 하는 프로그램

by ToolBOX01 2021. 1. 30.
반응형

■  IpfcSession.UISelectDirectory

IpfcSession 클래스 ▶ Function UISelectDirectory를 사용하여 작업공간을 선택 하는 프로그램

Sub UI_WORK_FOLDER()

    Dim asynconn As New pfcls.CCpfcAsyncConnection
    Dim conn As pfcls.IpfcAsyncConnection
    Dim Session As IpfcSession
    Set conn = asynconn.Connect("", "", ".", 5)
    Set Session = conn.Session
        
        
    Dim DirectorySelectioncreate As New CCpfcDirectorySelectionOptions
    Dim DirectorySelection As IpfcDirectorySelectionOptions
    Set DirectorySelection = DirectorySelectioncreate.Create
    
    Dim DirectoryName As String
    DirectoryName = Session.UISelectDirectory(oDirectorySelection)
    
    MsgBox DirectoryName
    
    'Disconnect with Creo
    conn.Disconnect (2)
    
End Sub

선택한 디렉토리 경로를 String으로 리턴 합니다.


영업 문의 : lionkk@idt21c.com