var ed = Application.DocumentManager.MdiActiveDocument.Editor; var opts = new PromptSelectionOptions(); opts.AllowSubSelections = true; opts.SingleOnly = true; opts.SelectEverythingInAperture = true; var psr = ed.GetSelection(opts); if (psr.Status == PromptStatus.OK) { var ssObj = psr.Value[0]; if (ssObj.SelectionMethod == SelectionMethod.PickPoint) { ed.WriteMessage("\nPick point: " + ((PickPointSelectedObject)ssObj).PickPoint.PointOnLine); } if (ssObj.SelectionMethod == SelectionMethod.SubEntity) { foreach (SelectedSubObject subEnt in ssObj.GetSubentities()) { if (subEnt.SelectionMethod == SelectionMethod.PickPoint) { ed.WriteMessage("\nSub entity pick point: " + ((PickPointSelectedSubObject)subEnt).PickPoint.PointOnLine); } } } }