you can use the Shell to Browse For a Folder
in autocad vba
Code:
'use the shell to browseforfolder
'Return "" if no folder
'return the path to the floder
Public Function GetFolder(Title As String) As String
Dim myShell
Dim myFolder
Dim myFolderItem
Dim myPath
Set myShell = AcadApplication.GetInterfaceObject("shell.Application")
Set myFolder = myShell.BrowseForFolder(0, Title, 0, 0)
If myFolder Is Nothing Then
GetFolder = ""
Else
Set myFolderItem = myFolder.Self
GetFolder = myFolderItem.Path
End If
End Function
or do it in Lisp
Note: will error if on folder is selected
Code:
(vl-load-com)
(defun getFolder()
(if (= myshell nil)
(setq myshell (vlax-create-object "shell.Application"))
()
)
(setq myfolder (vlax-invoke-method myshell "BrowseForFolder" 0 "tite"0))
(setq myfolderI(vlax-get-property myfolder "self"))
(setq mypaht (vlax-get-property myfolderi "path"))
)