If that doesn't work try this
static public bool CursorSelectionSet(ref SelectionSet ss,Point3d p)
{
Document doc=cad.DocumentManager.MdiActiveDocument;
Editor ed=doc.Editor;
Point3dCollection pts = CursorPts(p,ed);
PromptSelectionOptions sso = new PromptSelectionOptions();
sso.AllowDuplicates = false;
PromptSelectionResult psr = ed.SelectCrossingWindow(pts[0], pts[1]);
if (psr.Status != PromptStatus.OK) return false;
ss = psr.Value;
return true;
}
static public bool CursorSelectionSet(ref SelectionSet ss, Point3d p,SelectionFilter sf)
{
Document doc = cad.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
Point3dCollection pts = CursorPts(p, ed);
PromptSelectionOptions sso = new PromptSelectionOptions();
sso.AllowDuplicates = false;
PromptSelectionResult psr = ed.SelectCrossingWindow(pts[0], pts[1], sf);
if (psr.Status != PromptStatus.OK) return false;
ss = psr.Value;
return true;
}
static private Point3dCollection CursorPts(Point3d p,Editor ed)
{
double sc = Screensize().Y;
double ht = Viewsize();
double d = (Pickbox() / sc) * ht;
Matrix3d ucs = ed.CurrentUserCoordinateSystem;
Point3d u = p.TransformBy(ucs.Inverse());
Point3d p1 = new Point3d(u.X - d, u.Y - d, u.Z).TransformBy(ucs);
Point3d p2 = new Point3d(u.X + d, u.Y + d, u.Z).TransformBy(ucs);
Point3dCollection pts = new Point3dCollection();
pts.Add (p1); pts.Add(p2);
return pts;
}
static public int Pickbox()
{
//("pickbox")=pixels
return (int)(Int16)(cad.GetSystemVariable("Pickbox"));
}
static public Point2d Screensize()
{
//Screensize stores current viewport in pixels (x,y)
return (Point2d)cad.GetSystemVariable("Screensize");
}
static public double Viewsize()
{
//("viewsize")=Stores the height
//of the view in the current viewport. Expressed in drawing units
return (double)cad.GetSystemVariable("viewsize");
}
call it with
SelectionSet ss = null;
TypedValue[] filterList = { new TypedValue(0, "INSERT") };
SelectionFilter sf = new SelectionFilter(filterList);
if (SSets.SSets.CursorSelectionSet(ref ss, pickedpoint, sf))
{
//yada yada
}
It's not too elegant but it is related to how a pickbox works