PromptFileOptions / GetFileNameForOpen 不能正确使用过滤器,在打开文件对话框中不能过滤出指定的文件类型,如下图:

正确的表现应该下面这样的:

代码如下:
    <CommandMethod("test", CommandFlags.Modal)>
    Public Sub Test1()
        Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
        Try
            Dim opt As New PromptOpenFileOptions("请选择文件") With {.Filter = "CAD文件(*.dwg)|*.dwg"}
            Dim res As PromptFileNameResult = ed.GetFileNameForOpen(opt)
            If res.Status = PromptStatus.OK Then
                ed.WriteMessage(res.StringResult)
            End If
        Catch ex As Exception
        End Try
    End Sub
                    





















