马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 csharp 于 2014-6-13 18:21 编辑

- [CommandMethod("fod")]
- public void testOpenFileDial()
- {
- Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
- OpenFileDialog.OpenFileDialogFlags flags = OpenFileDialog.OpenFileDialogFlags.AllowMultiple
- | OpenFileDialog.OpenFileDialogFlags.DefaultIsFolder;
- Autodesk.AutoCAD.Windows.OpenFileDialog dlg = new OpenFileDialog(
- "选择DWG文件", null, "dwg", "MyTestSeletct",
- flags);
- System.Windows.Forms.DialogResult dr = dlg.ShowDialog();
- if (dr == DialogResult.OK)
- {
- string[] fls = dlg.GetFilenames();
- for (int i = 0; i < fls.Length; i++)
- {
- ed.WriteMessage(fls[i] + "\n");
- }
- }
- }
需要添加 System.Windows.Forms 引用 |