Click or drag to resize

Point3dTransform Method

Transforms the present point in place. The transformation matrix acts on the left of the point. i.e.,

result = transformation*point

Namespace:  Rhino.Geometry
Assembly:  RhinoCommon (in RhinoCommon.dll)
public void Transform(
	Transform xform


Type: Rhino.GeometryTransform
Transformation to apply.
using Rhino;
using Rhino.Commands;
using Rhino.DocObjects;
using System;

namespace examples_cs
  public class PointAtCursorCommand : Command
    public override string EnglishName { get { return "csPointAtCursor"; } }

    public static extern bool GetCursorPos(out System.Drawing.Point point);

    public static extern bool ScreenToClient(IntPtr hWnd, ref System.Drawing.Point point);

    protected override Result RunCommand(RhinoDoc doc, RunMode mode)
      var result = Result.Failure;
      var view = doc.Views.ActiveView;
      if (view == null) return result;

      System.Drawing.Point windows_drawing_point;
      if (!GetCursorPos(out windows_drawing_point) || !ScreenToClient(view.Handle, ref windows_drawing_point))
        return result;

      var xform = view.ActiveViewport.GetTransform(CoordinateSystem.Screen, CoordinateSystem.World);
      var point = new Rhino.Geometry.Point3d(windows_drawing_point.X, windows_drawing_point.Y, 0.0);
      RhinoApp.WriteLine("screen point: ({0})", point);
      RhinoApp.WriteLine("world point: ({0})", point);
      result = Result.Success;
      return result;
Version Information

Rhino for Mac

Supported in: 5.4

Rhino for Windows

Supported in: 6.2
See Also