您好,我测试了您的代码缺失存在问题,感谢反馈! 另外我测试了另外一种方法请试用:
<CommandMethod("test2", CommandFlags.Modal)>
Public Sub Test2()
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
Try
Dim opt As New OpenFileDialog("请选择文件", "", "dwg", "", OpenFileDialog.OpenFileDialogFlags.DoNotTransferRemoteFiles)
Dim re As System.Windows.Forms.DialogResult
re = opt.ShowDialog()
If re = System.Windows.Forms.DialogResult.OK Then
ed.WriteMessage(opt.Filename)
End If
Catch ex As Exception
End Try
End Sub
👍