Author Topic: create SelectionSet during jig? I can't get Editor.Select... to get anything.  (Read 2083 times)

0 Members and 1 Guest are viewing this topic.

dugk

  • Guest
I'm trying to get a blockJig to insert on a line and use the angle of the line as the block rotation.  I've got the block inserting with the jig and now I'm trying to get the Jig to use the cursorPoint and then create a selection set via any of the Editor.Select... methods.

Has anyone done something like this successfully?  If so can you give me some hints?

The blockJig is basically is the same as in this post:  http://www.theswamp.org/index.php?topic=34136.0

I've added a call to this code in the Update method of the blockJig:
Code: [Select]
       public static SelectionSet ssGetAtPoint(Point3d point)
        {
            Document acActiveDoc = AcApSrvApp.DocumentManager.MdiActiveDocument;
            Database acCurDb = acActiveDoc.Database;
            Editor acDocEd = acActiveDoc.Editor;
            double pickboxSize = aCommon.Methods.screenAspectRatio();
            Point3d point01 = aCommon.GeomExt.Polar(point, aCommon.Methods.Degrees_Radians_Conversion(045, false), pickboxSize);
            Point3d point02 = aCommon.GeomExt.Polar(point, aCommon.Methods.Degrees_Radians_Conversion(225, false), pickboxSize);
            Point3dCollection points = new Point3dCollection();
            points.Add(point02);
            points.Add(new Point3d(point01.X, point02.Y, point.Z));
            points.Add(point01);
            points.Add(new Point3d(point02.X, point01.Y, point.Z));
            PromptSelectionResult res = acDocEd.SelectCrossingPolygon(points);
            if (res.Status != PromptStatus.OK)
                return null;

            return res.Value;
        }

I've confirmed the code above works outside a Jig.

The screenAspectRatio() code can be gotten from this post, if needed:  http://www.theswamp.org/index.php?topic=34622.0

Thanks for you help, comments and suggestions!
« Last Edit: September 03, 2010, 05:15:51 PM by dugk »

dugk

  • Guest
From ADN:
Sorry, selection won’t work from inside Jig functions. An “Editor.PointMonitor” is your best bet for retrieving displayed entities (under the aperture).

:(