public override int Proc(IntPtr hwnd, int msg, int point, int flags, IIPoint2 m) { Debug.Print("viewport point: " + m.X + ", " + m.Y); switch (msg) { case 0: // MOUSE_ABORT see .\maxsdk\include\mouseman.h for all possible values { IGlobal global = Autodesk.Max.GlobalInterface.Instance; IInterface14 ip = global.COREInterface14; ip.PopCommandMode(); Debug.Print("mouse callback aborted"); } break; case 1: // MOUSE_POINT see .\maxsdk\include\mouseman.h for all possible values { if (point == 0) { IGlobal global = Autodesk.Max.GlobalInterface.Instance; IInterface14 ip = global.COREInterface14; IViewExp vp = ip.ActiveViewExp; IPoint3 pt = vp.SnapPoint(m, m, null, SnapFlags.InPlane); ip.PopCommandMode(); Debug.Print("3d point (in plane): " + pt.X + ", " + pt.Y + ", " + pt.Z); } // else if ... other points if you have more than one... } break; default: break; } return(1); }
public override void BeingDestroyed(IIPoint2 pos) { }