Hi everyone,
I’m trying to create a C# script in Grasshopper that automatically adjusts the TOP viewport zoom so that the objects appear at real physical scale on my monitor — similar to Rhino’s Zoom 1To1 or Zoom 1To1 Calibration commands.
For instance, if I draw a rectangle of 100 x 25 mm in Rhino and place a physical ruler against the screen, I’d like it to measure exactly 100 mm x 25 mm on screen.
However, since the built-in Zoom 1To1 command is tied to Rhino’s current unit system and calibration, I’d like to handle the scaling directly in Grasshopper. My goal is to:
-
Trigger the zoom using a boolean input (so it updates only when needed).
-
Adjust the scale easily using a numeric input (e.g., 1, 10, 100, 1000) to switch between mm, cm, m, etc.
-
Optionally, have the script automatically detect the screen DPI, avoiding manual calibration.
The idea might sound simple, but it would be very useful for quickly comparing digital objects to real-world items placed against the screen — kind of a fast visual verification tool.
Has anyone tried implementing something similar in C# or knows how to map model-space units to real-world screen millimeters accurately within the Rhino viewport?
Any suggestions, tips, or code examples would be really appreciated.
Thanks in advance!
1-1_zoom.gh (5.8 KB)
