RhinoView

References
public class RhinoView
A RhinoView represents a single "window" display of a document. A view could contain one or many RhinoViewports (many in the case of Layout views with detail viewports). Standard Rhino modeling views have one viewport.

Properties

ActiveViewport

#ExampleSince v5.0
The ActiveViewport is the same as the MainViewport for standard RhinoViews. In a RhinoPageView, the active viewport may be the RhinoViewport of a child detail object. Most of the time, you will use ActiveViewport unless you explicitly need to work with the main viewport.
public virtual RhinoViewport ActiveViewport { get; }

ActiveViewportID

#Since v5.0
Returns viewport ID for the active viewport. Faster than ActiveViewport function when working with page views.
public Guid ActiveViewportID { get; }

Bounds

#Since v5.0
Gets the size and location of the view including its non-client elements, in pixels, relative to the parent control.
public Rectangle Bounds { get; }

ClientRectangle

#Since v5.0
Gets the rectangle that represents the client area of the view.
public Rectangle ClientRectangle { get; }

DisplayPipeline

#Since v6.0
Gets the display pipeline used for this view.
public DisplayPipeline DisplayPipeline { get; }

Document

#Since v5.0
public RhinoDoc Document { get; }

EnableDrawing

#Since v5.0
Gets or sets the 'drawing enabled' flag. By default, drawing is enabled.

There are some rare situations where scripts want to disable drawing for a while.

public static bool EnableDrawing { get; set; }

Floating

#Since v5.0
Floating state of RhinoView. if true, then the view will be in a floating frame window. Otherwise the view will be embedded in the main frame.
public bool Floating { get; set; }

Handle

#Since v5.0
Gets the window handle that this view is bound to.
public nint Handle { get; }

InDynamicViewChange

#Since v8.1
true if the view is being dynamically changed by mouse moves, arrow keys, trackballs, etc.
public bool InDynamicViewChange { get; }

MainViewport

#Since v5.0
A RhinoView contains a "main viewport" that fills the entire view client window. RhinoPageViews may also contain nested child RhinoViewports for implementing detail viewports. The MainViewport will always return this RhinoView's m_vp.
public RhinoViewport MainViewport { get; }

Maximized

#Since v5.0
public bool Maximized { get; set; }

RealtimeDisplayMode

#Since v6.0
Gets the RealtimeDisplayMode active for this view. null if the view doesn't have a RealtimeDisplayMode set.
public RealtimeDisplayMode RealtimeDisplayMode { get; }

RuntimeSerialNumber

#Since v6.0
[CLSCompliant(false)] public uint RuntimeSerialNumber { get; }

ScreenRectangle

#Since v5.0
Gets the rectangle that represents the client area of the view in screen coordinates.
public Rectangle ScreenRectangle { get; }

Size

#Since v6.0
Gets or sets the size of the view
public Size Size { get; set; }

TitleVisible

#Since v5.0
Visibility of the viewport title window.
public bool TitleVisible { get; set; }

Methods

CaptureToBitmap

#Since v5.0
Capture View contents to a bitmap.
public Bitmap CaptureToBitmap()
The bitmap of the complete view.

CaptureToBitmap

#ExampleSince v5.0
Captures the view contents to a bitmap allowing for visibility of grid and axes.
public Bitmap CaptureToBitmap(
grid,
true if the construction plane grid should be visible.
worldAxes,
true if the world axis should be visible.
cplaneAxes
true if the construction plane close the grid should be visible.
)
A new bitmap.

CaptureToBitmap

#Since v5.0
Capture View contents to a bitmap using a display mode description to define how drawing is performed.
public Bitmap CaptureToBitmap(
mode
The display mode.
)
A new bitmap.

CaptureToBitmap

#Since v5.0
Captures view contents to a bitmap using display attributes to define how drawing is performed.
public Bitmap CaptureToBitmap(
attributes
The specific display mode attributes.
)
A new bitmap.

CaptureToBitmap

#Since v5.0
Captures a part of the view contents to a bitmap allowing for visibility of grid and axes.
public Bitmap CaptureToBitmap(
size,
The width and height of the returned bitmap.
grid,
true if the construction plane grid should be visible.
worldAxes,
true if the world axis should be visible.
cplaneAxes
true if the construction plane close the grid should be visible.
)
A new bitmap.

CaptureToBitmap

#Since v5.0
Capture View contents to a bitmap using a display mode description to define how drawing is performed.
public Bitmap CaptureToBitmap(
size,
The width and height of the returned bitmap.
mode
The display mode.
)
A new bitmap.

CaptureToBitmap

#Since v5.0
Capture View contents to a bitmap using display attributes to define how drawing is performed.
public Bitmap CaptureToBitmap(
size,
The width and height of the returned bitmap.
attributes
The specific display mode attributes.
)
A new bitmap.

CaptureToBitmap

#Since v5.0
Capture View contents to a bitmap.
public Bitmap CaptureToBitmap(
size
Size of Bitmap to capture to.
)
The bitmap of the specified part of the view.

ClientToScreen

#Since v5.0
public Point ClientToScreen(
clientPoint
)

ClientToScreen

#Since v5.0
public Point2d ClientToScreen(
clientPoint
)

Close

#Since v5.0
Remove this View from Rhino. DO NOT attempt to use this instance of this class after calling Close.
public bool Close()
true on success

CreateShadedPreviewImage

#Since v5.0
Creates a bitmap preview image of model.
public bool CreateShadedPreviewImage(
imagePath,
[in] The name of the bitmap file to create. The extension of the imagePath controls the format of the bitmap file created (BMP, TGA, JPG, PCX, PNG, TIF).
size,
[in] The width and height of the bitmap in pixels.
ignoreHighlights,
true if highlighted elements should be drawn normally.
drawConstructionPlane,
true if the CPlane should be drawn.
useGhostedShading
true if ghosted shading (partially transparent shading) should be used.
)
true if successful.

CreateWireframePreviewImage

#Since v5.0
Creates a bitmap preview image of model.
public bool CreateWireframePreviewImage(
imagePath,
[in] The name of the bitmap file to create. The extension of the imagePath controls the format of the bitmap file created (BMP, TGA, JPG, PCX, PNG, TIF).
size,
[in] The width and height of the bitmap in pixels.
ignoreHighlights,
true if highlighted elements should be drawn normally.
drawConstructionPlane
true if the CPlane should be drawn.
)
true if successful.

Equals

#
public override bool Equals(
obj
)
Object.Equals

FromRuntimeSerialNumber

#Since v6.0
Get a RhinoView from it's unique runtime serial number
[CLSCompliant(false)] public static RhinoView FromRuntimeSerialNumber(
serialNumber
)
RhinoView or null if no view exists for a given serial number

GetHashCode

#
public override int GetHashCode()

MouseCaptured

#Since v6.0
Returns whether or not the mouse is captured in this view.
public bool MouseCaptured(
bIncludeMovement
If captured, test if the mouse has moved between mouse button down and mouse button up.
)
true if captured, false otherwise.

Redraw

#ExampleSince v5.0
Redraws this view.
public void Redraw()
Remarks: If you change something in "this" view like the projection, construction plane, background bitmap, etc., then you need to call RhinoView.Redraw() to redraw "this" view./ The other views will not be changed. If you change something in the document (like adding new geometry to the model), then you need to call RhinoDoc.Views.Redraw() to redraw all the views.

RedrawOverlays

#Since v9.0
Redraws this view without regenerating its contents, when possible.
public void RedrawOverlays()
Remarks: Use this when only what display conduits draw in the DrawOverlay channel has changed. If nothing in the document or view has changed since the last frame, the previously captured frame is reused and only the overlays are drawn on top of it, which is much faster than Redraw() for expensive scenes such as layouts with many details. If something has changed, the view is fully redrawn, the same as Redraw().

ScreenToClient

#Since v5.0
Converts a point in screen coordinates to client coordinates for this view.
public Point ScreenToClient(
screenPoint
The 2D screen point.
)
A 2D point in client coordinates.

ScreenToClient

#Since v5.8
public Point2d ScreenToClient(
screenPoint
)

ShowToast

#Since v8.0
Shows a temporary popup message in the lower right corner of the view
[CLSCompliant(false)] public uint ShowToast(
message,
The message to be shown
textHeight,
The height of the message
location
The location of the message
)
The runtime serial number of the view toast

ShowToast

#Since v8.0
Shows a temporary popup message in the lower right corner of the view
[CLSCompliant(false)] public uint ShowToast(
message,
The message to be shown
textHeight
The height of the message
)
The runtime serial number of the view toast

ShowToast

#Since v8.0
Shows a temporary popup message in the lower right corner of the view
[CLSCompliant(false)] public uint ShowToast(
message
The message to be shown
)
The runtime serial number of the view toast

SpeedTest

#Since v5.8
public double SpeedTest(
frameCount,
freezeDrawList,
direction,
angleDeltaRadians
)

Events

Create

#Since v5.0
public static event EventHandler<ViewEventArgs> Create

Destroy

#Since v5.0
public static event EventHandler<ViewEventArgs> Destroy

EnableDrawingChanged

#Since v8.15
Called when the state of EnableDrawing changes.
public static event EventHandler<ViewEnableDrawingEventArgs> EnableDrawingChanged

Modified

#Since v7.0
public static event EventHandler<ViewEventArgs> Modified

Rename

#Since v5.0
public static event EventHandler<ViewEventArgs> Rename

SetActive

#Since v5.0
public static event EventHandler<ViewEventArgs> SetActive