If you want to transform some from one coordinate system to another (e.g. from world xy-plane to construction plane or vise versa), then create a change of basis transformation - Transform.ChangeBasis.
What I understood is that this method GetObject requires a mouse click, right? What if I just want to track the location of the cursor?
I have something similar to @pythonuser which can successfully track the cursor. While I am wondering why there is a “gap”… between the cursor and the point(see below gif)… Could you give me some suggestions?
//current viewport
var view = doc.Views.ActiveView;
//xform matrix
var xform = view.ActiveViewport.GetTransform(Rhino.DocObjects.CoordinateSystem.Screen, Rhino.DocObjects.CoordinateSystem.World);
//cursor(screen coordinate system)
var point = new Rhino.Geometry.Point3d(Rhino.UI.MouseCursor.Location.X, Rhino.UI.MouseCursor.Location.Y, 0.0);
//transform
point.Transform(xform);
Line cursorToOrigin = new Line(point, new Point3d(0, 0, 0));
A = point;
B = cursorToOrigin;
Hi Dale,
thanks again for the prompt reply. I want to create a sort of interaction between the cursor and Rhino. GetPoint is a solution while it requires user’s input through Rhino console. I think the “cursor” way is more smooth🤔