public void CMD_BOQEdit() { if (!CheckLicense.Check()) { return; } Autodesk.AutoCAD.EditorInput.Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor; // Edit entity if there is a pickset PromptSelectionResult selectionRes = ed.SelectImplied(); if (selectionRes.Status != PromptStatus.Error && selectionRes.Value.Count > 0) { ObjectId id = selectionRes.Value[0].ObjectId; ed.SetImpliedSelection(new ObjectId[0]); ItemEdit(id, MonitoredPoint); return; } PromptEntityOptions opts = new PromptEntityOptions("Select entity: "); opts.AllowNone = false; PromptEntityResult result = ed.GetEntity(opts); if (result.Status == PromptStatus.OK) { ItemEdit(result.ObjectId, result.PickedPoint); } }
public void CMD_Pos() { if (!CheckLicense.Check()) { return; } Autodesk.AutoCAD.EditorInput.Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor; // Edit entity if there is a pickset PromptSelectionResult selectionRes = ed.SelectImplied(); if (selectionRes.Status != PromptStatus.Error && selectionRes.Value.Count > 0) { ObjectId id = selectionRes.Value[0].ObjectId; ed.SetImpliedSelection(new ObjectId[0]); ItemEdit(id, MonitoredPoint); return; } bool cont = true; while (cont) { PromptEntityOptions opts = new PromptEntityOptions("Poz secin veya [Yeni/Numaralandir/Kopyala/kOntrol/Metraj/bul Degistir/numara Sil/Acilimlar/Tablo stili/ayaRlar]: ", "New Numbering Copy Check BOQ Find Empty Shapes Table Preferences"); opts.AllowNone = false; PromptEntityResult result = ed.GetEntity(opts); if (result.Status == PromptStatus.Keyword) { switch (result.StringResult) { case "New": NewPos(); break; case "Numbering": NumberPos(); break; case "Empty": EmptyBalloons(); break; case "Copy": CopyPos(); break; case "Check": PosCheck(); break; case "BOQ": DrawBOQ(); break; case "Find": FindReplace(false); break; case "Shapes": PosShapes(); break; case "Table": TableStyles(); break; case "Preferences": PosGroups(); break; } cont = false; } else if (result.Status == PromptStatus.OK) { ItemEdit(result.ObjectId, result.PickedPoint); cont = true; } else { cont = false; } } }