[CommandMethod("selCelTable")]
public void CellOfTable()
{
Document document = Application.DocumentManager.MdiActiveDocument;
Editor ed = document.Editor;
Database db = document.Database;
Editor acDocEd = Application.DocumentManager.MdiActiveDocument.Editor;
PromptPointResult pPtRes;
PromptPointOptions pPtOpts = new PromptPointOptions("");
// Prompt for the start point
pPtOpts.Message = "\nEnter the start point: ";
pPtRes = document.Editor.GetPoint(pPtOpts);
Point3d ptStart = pPtRes.Value;
// Exit if the user presses ESC or cancels the command
if (pPtRes.Status == PromptStatus.Cancel) return;
// Prompt for the end point
pPtOpts.Message = "\nEnter the end point: ";
pPtOpts.UseBasePoint = true;
pPtOpts.BasePoint = ptStart;
pPtRes = document.Editor.GetCorner(pPtOpts);
Point3d ptEnd = pPtRes.Value;
if (pPtRes.Status == PromptStatus.Cancel) return;
PromptSelectionResult res = ed.SelectWindow(ptStart, ptEnd);
if (res.Status != PromptStatus.OK)
return;
SelectionSet sset = res.Value;
if (sset.Count == 0)
return;
}