Screen Location Viewport

Hi there,

I’m looking a way to find the Location of a viewport (I need this so I can locate a form on the right location on the screen).

I’ve been looking in doc.Views.ActiveView.ActiveViewport… but can’t find anything yet.
Anyone know how to get the screen x and y location?


Hi Jordy,

Most probably you need to look at properties of Viewport.Bounds.


1 Like

This bounds is based on the location of the viewport. Not of the screen. :frowning:
I would guess it should be around Point(45,145) or something.

  • Jordy


doc.Views.ActiveView.ScreenRectangle gives me the right location and size.

The RhinoView is the ‘window’ itself and that is where you will find things like screen coordinates. A RhinoView always contains at least one viewport (in the case of standard modeling views). RhinoViews can contain multiple viewports if you are working with layouts and details.