private void MoveJLBItem_Click(object sender, EventArgs e) { try { var isLock = DBEntityFinder.Instance.VerifyLTTID(detail_fid); if (!isLock) { PublicMethod.Instance.AlertDialog("详图没有被工单锁定,不能迁移计量表!"); Show(); return; } var movept = dddMap.screen2geo(mouseLocation.X, mouseLocation.Y); var detail = DBManager.Instance.GetEntities <Detailreference_n>( o => o.G3E_FID == detail_fid && o.EntityState != EntityState.Delete).FirstOrDefault(); if (detail != null) { if (detail.G3E_DETAILID == null) { return; } var tt = new JLBMove((long)detail.G3E_DETAILID, movept); var res = Application.ShowModalDialog(tt); if (res == DialogResult.OK) { // 加一个计量表,刷新窗口 var pb = new JlbPB(); pb.Height = picWheight; pb.Width = picWwidth; pb.Location = new System.Drawing.Point((int)mouseLocation.X - picWwidth / 2, (int)mouseLocation.Y - picWheight / 2); if (tt.SBLX == "高供高计") { pb.Image = imageList1.Images[0]; } else { pb.Image = imageList1.Images[1]; } pb.Tag = tt.g3e_Fid; pb.ContextMenuStrip = contextMenuStrip2; pb.JlbPBPosition = new Point3d(movept[1], movept[0], 0); pb.JlbPBFid = tt.g3e_Fid; pb.JlbSBLX = tt.SBLX; pb.SizeMode = PictureBoxSizeMode.StretchImage; pb.MouseDoubleClick += pb_MouseDoubleClick; pb.MouseDown += pb_MouseDown; pb.MouseHover += pb_MouseHover; pb.MouseUp += pb_MouseUp; pb.MouseMove += pb_MouseMove; pbs.Add(pb); Controls.Add(pb); } } } catch (Exception ex) { LogManager.Instance.Error(ex); } }
public void TabView() { Editor editor = AfaDocData.ActiveDocData.DocDataset.ParentDocument.Editor; try { try { int arg_25_0 = editor.SelectAll().Value.Count; } catch { editor.WriteMessage("\n" + AfaStrings.NoFeaturesFound); return; } MSCFeatureClass activeFeatureClassOrSubtype = AfaDocData.ActiveDocData.GetActiveFeatureClassOrSubtype(); if (activeFeatureClassOrSubtype == null) { editor.WriteMessage("\n" + AfaStrings.NoCurrentFeatureClassFound); } else { TableView tableView = new TableView(activeFeatureClassOrSubtype); Application.ShowModalDialog(Application.MainWindow.Handle, tableView, true); tableView.Uninitialize(); tableView.Dispose(); } } catch { editor.WriteMessage("\nError"); } }
public void ShowProcessingDialog() { ThumnailProcessDlg thumnailProcessDlg = new ThumnailProcessDlg(0, false, ""); thumnailProcessDlg.RootPath.Text = "这里显示CAD文件夹路径"; AcadApp.ShowModalDialog(AcadApp.MainWindow.Handle, thumnailProcessDlg); }
private void ToolSMI_UploadCADToGIS_Click(object sender, EventArgs e) { if (!PublicMethod.Instance.IsExecuteSystemCMD("")) { var upload = new Upload.UploadCAD(fileName); Application.ShowModalDialog(upload); } }
static public void bview() // This method can have any name { // create a new instance of the dialog using (BlockViewDialog blockViewDlg = new BlockViewDialog()) { // now show it as a model form in AutoCAD AcadApp.ShowModalDialog(blockViewDlg); } }
/*馈线管理*/ private void ToolSMI_Kxgl_Click(object sender, EventArgs e) { if (!IsLoadDataSource()) { return; } var fm = new FeederManagement(); Application.ShowModalDialog(fm); }
public void ListAttributes() { var dlg = new AttributeSyncForm(); dlg.BlockName = "Old"; if (AcAp.ShowModalDialog(dlg) == DialogResult.OK) { AcAp.ShowAlertDialog(dlg.BlockName); } }
/*型号规格管理*/ private void ToolSMI_CDManager_Click(object sender, EventArgs e) { if (!IsLoadDataSource()) { return; } if (!PublicMethod.Instance.IsExecuteSystemCMD("")) { var xhgeManager = new XHGEManagerForm(); Application.ShowModalDialog(xhgeManager); } }
/*增量合并*/ private void ToolSMI_MergerXml_Click(object sender, EventArgs e) { if (!IsLoadDataSource()) { return; } if (!PublicMethod.Instance.IsExecuteSystemCMD("")) { var mergerXml = new MergerIncrementXml(); Application.ShowModalDialog(mergerXml); } }
private void TSM_CustomSymbol_Click(object sender, EventArgs e) { if (!IsLoadDataSource()) { return; } if (!PublicMethod.Instance.IsExecuteSystemCMD("")) { ViewHelper.HideConnectPsState(); var css = new CustomSymbolSet(); Application.ShowModalDialog(css); } }
private void SetTraceItem_Click(object sender, EventArgs e) { if (!IsLoadDataSource()) { return; } if (!PublicMethod.Instance.IsExecuteSystemCMD("")) { var tt = new SetColor(); if (Application.ShowModalDialog(tt) == DialogResult.OK) { PublicMethod.Instance.traceColor = tt.ccolor; } } }
/*新增支线*/ private void TSM_AddLateral_Click_1(object sender, EventArgs e) { using (PublicMethod.Instance.acDoc.LockDocument()) { if (!PublicMethod.Instance.IsExecuteSystemCMD("")) { if (!IsLoadDataSource()) { return; } var form = new AddLateral(); Application.ShowModalDialog(form); } } }
private void btnIronrectpipe_Click(object sender, EventArgs e) { FtLgScForm ftlgscfrm = new FtLgScForm();; //ftlgscfrm.Show(); var result = AcAp.ShowModalDialog(ftlgscfrm); if (result == DialogResult.OK) { AcAp.ShowAlertDialog("Pickup point"); } else { AcAp.ShowModalDialog(ftlgscfrm); } }
public static void DisplaySplashScreen() { Application.ShowModalDialog(new SplashScreen { Text = "ArcGIS for AutoCAD 300 SP1", StartPosition = FormStartPosition.CenterScreen, FormBorderStyle = FormBorderStyle.FixedSingle, TopMost = true, ShowInTaskbar = false, errMsg = { Visible = false }, UseWaitCursor = false, Cursor = Cursors.Default }); }
public static void XrefDwgFromAnother() { var doc = AcApp.DocumentManager.MdiActiveDocument; if (doc == null) { return; } var ed = doc.Editor; GetJobNumber form1 = new GetJobNumber(); var f1r = AcApp.ShowModalDialog(form1); if (f1r == DialogResult.Cancel) { ed.WriteMessage("No job number could be determined. Exiting." + Environment.NewLine); return; } ed.WriteMessage($"Going to job number {form1.Value}." + Environment.NewLine); Autodesk.AutoCAD.Windows.OpenFileDialog ofd = new Autodesk.AutoCAD.Windows.OpenFileDialog( "Please select a file to x-ref", JobNumber.GetPath(form1.Value), "dwg", "DwgFileToLink", Autodesk.AutoCAD.Windows.OpenFileDialog.OpenFileDialogFlags.DefaultIsFolder ); var pr = ofd.ShowDialog(); if (pr == DialogResult.OK && !string.IsNullOrEmpty(ofd.Filename)) { AttachXRef(ofd.Filename); } form1.Dispose(); doc.Dispose(); }
public void DwgStdBlock() { string _Path = Properties.Settings.Default.StdBlockPath; //string Code = GetMd5Hash(MD5.Create(), EncryString); /* * if (Properties.Settings.Default.verifycode != Code) * { * AcadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage("未注册软件,请注册后再使用"); * return; * }*/ if (Directory.Exists(_Path)) { LibaryDialog Diag = new LibaryDialog(_Path, "中建深装-标准图块图库", LibType.BlockLib); AcadApp.ShowModalDialog(Diag); } else { AcadApp.ShowAlertDialog(string.Format("路径:{0}不存在,请先设置正确的图库加载路径", _Path)); } }
public static void ImportJobPoints() { var doc = AcApp.DocumentManager.MdiActiveDocument; Editor ed = doc.Editor; Database db = doc.Database; var jobNumber = Functions.GetJobNumber(doc); SelectionForm form = new SelectionForm(jobNumber); var ret = AcApp.ShowModalDialog(form); if (ret == DialogResult.Cancel) { ed.WriteMessage("Job import canceled by user."); return; } else { ed.WriteMessage($"Import Job list: Count - {form.SelectedFiles.Count} | Filtered - {form.FilterPoints} | X-ref attach - {form.AttachXref}" + Environment.NewLine); List <List <C3DPoint> > pointList = IntFunctions.ProcessFiles(form.SelectedFiles); //Actually do the things using (Transaction trans = ed.Document.Database.TransactionManager.StartTransaction()) { List <CogoPoint> existingPoints = new List <CogoPoint> { }; CogoPointCollection cogoPoints = CivilApplication.ActiveDocument.CogoPoints; foreach (var cogoPointObj in cogoPoints) { CogoPoint cogoPointItem = cogoPointObj.GetObject(OpenMode.ForWrite) as CogoPoint; existingPoints.Add(cogoPointItem); } string confirmed = ""; for (int i = 0; i < pointList.Count; i++) { var points = pointList[i]; int pointcount = 0; foreach (var newPoint in points) { if (existingPoints.Where(pn => pn.PointNumber == newPoint.PointNumber).Count() == 0) { Point3d point = newPoint.Coordinate; ObjectId pointId = cogoPoints.Add(point, false); CogoPoint cogop = pointId.GetObject(OpenMode.ForWrite) as CogoPoint; cogop.PointNumber = newPoint.PointNumber; cogop.RawDescription = newPoint.Decsription; cogop.StyleId = ObjectId.Null; cogop.LabelStyleId = ObjectId.Null; existingPoints.Add(cogop); confirmed += $"{newPoint.PointNumber}, "; pointcount++; } else { /*if (points.Where(pn => pn.RawDescription == (string)newPoint[4]).Count() == 0) * { * MessageBox.Show("A point with a conflicting point number was detected. You can renumber this."); * } * else * { * MessageBox.Show("A point with a conflicting point number and description was detected. Ingoring a duplicate point"); * }*/ } } //TODO: Add more fuctionality to point group. string filename = Path.GetFileNameWithoutExtension(form.SelectedFiles[i]); ed.WriteMessage($"Successfully imported {pointcount} points." + Environment.NewLine); if (form.AttachXref) { string folder = Path.GetDirectoryName(form.SelectedFiles[i]); string CADFile = Path.Combine(folder, filename + ".dwg"); if (File.Exists(Path.Combine(folder, filename + ".dwg"))) { //Getting the layer object LayerTable lt = (LayerTable)trans.GetObject(db.LayerTableId, OpenMode.ForWrite); if (!lt.Has("G-HH-XREF")) { LayerTableRecord ltr = new LayerTableRecord { Name = "G-HH-XREF", Color = Autodesk.AutoCAD.Colors.Color.FromColorIndex(ColorMethod.ByAci, 7), IsFrozen = false, ViewportVisibilityDefault = true }; ObjectId ltId = lt.Add(ltr); trans.AddNewlyCreatedDBObject(ltr, true); } var xId = db.AttachXref(CADFile, filename); if (xId.IsValid) { var btr = (BlockTableRecord)trans.GetObject(db.CurrentSpaceId, OpenMode.ForWrite); var br = new BlockReference(Point3d.Origin, xId) { Layer = "G-HH-XREF" }; btr.AppendEntity(br); trans.AddNewlyCreatedDBObject(br, true); } } ed.WriteMessage($"Successfully attached {filename} CAD file." + Environment.NewLine); } } PointGroupCollection pointGroups = CivilApplication.ActiveDocument.PointGroups; string groupName = "Group Import " + DateTime.Now.ToString("MM-dd-yy"); if (!pointGroups.Contains(groupName)) { ObjectId pointGroup = pointGroups.Add(groupName); StandardPointGroupQuery query = new StandardPointGroupQuery { IncludeNumbers = confirmed }; PointGroup group = (PointGroup)pointGroup.GetObject(OpenMode.ForWrite); group.SetQuery(query); } /*foreach (var newPoint in newPoints) * { * if (points.Where(pn => pn.PointNumber == (uint)newPoint[0]).Count() == 0) * { * Point3d point = new Point3d((double)newPoint[2], (double)newPoint[1], (double)newPoint[3]); * ObjectId pointId = cogoPoints.Add(point, false); * CogoPoint cogop = pointId.GetObject(OpenMode.ForWrite) as CogoPoint; * cogop.PointNumber = (uint)newPoint[0]; * cogop.RawDescription = (string)newPoint[4]; * points.Add(cogop); * } * else * { * if (points.Where(pn => pn.RawDescription == (string)newPoint[4]).Count() == 0) * { * MessageBox.Show("A point with a conflicting point number was detected. You can renumber this."); * } * else * { * MessageBox.Show("A point with a conflicting point number and description was detected. Ingoring a duplicate point"); * } * } * }*/ object acad = AcApp.AcadApplication; acad.GetType().InvokeMember("ZoomExtents", BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance | BindingFlags.InvokeMethod, null, acad, null); trans.Commit(); } } Logging.LogEntry(jobNumber, "POINT IMPORT", "Points were added to drawing."); form.Dispose(); ed.Regen(); }
public void cmdShowInteractionModelDialog() { var frm = new FormModalInteration(); AcApp.ShowModalDialog(frm); }
public void cmdShowModelDialog() { var frm = new FormModal(); AcApp.ShowModalDialog(frm); }
/*选项*/ private void TSMI_Option_Click(object sender, EventArgs e) { var option = new Option(); Application.ShowModalDialog(option); }
/// <summary> /// 用于设置 /// </summary> // [CommandMethod("libsetting")] public void ShowlibsettingDialog() { SetttingDlg _SettingDlg = new SetttingDlg(); AcadApp.ShowModalDialog(AcadApp.MainWindow.Handle, _SettingDlg); }
public void ShowAboutDialog() { AboutDlg _AboutDlg = new AboutDlg(); AcadApp.ShowModalDialog(AcadApp.MainWindow.Handle, _AboutDlg); }