//新建dwg文档 private void t2Create_ItemClick(object sender, EventArgs e) { int id = treeList2.FocusedNode.Id; List <FilesTreeNode> data = treeList2.DataSource as List <FilesTreeNode>; string name = null; NewDwgForm f = new NewDwgForm(); f.OK += (object s, string str) => { name = str; f.Close(); }; Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(f); if (name == null) { return; } if (!File.Exists(Fs.FormatDwgName(data[id].FullName, name))) { Fs.createDwg(data[id].FullName, name); } else { Autodesk.AutoCAD.ApplicationServices.Application. ShowAlertDialog("该位置已有同名的文件"); } }