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
public virtual RhinoViewport ActiveViewport { get; }
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.

ActiveViewportID

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

Bounds

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

ClientRectangle

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

DisplayPipeline

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

Document

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

EnableDrawing

#Since v5.0
public static bool EnableDrawing { get; set; }
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.

Floating

#Since v5.0
public bool Floating { get; set; }
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.

Handle

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

InDynamicViewChange

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

MainViewport

#Since v5.0
public RhinoViewport MainViewport { get; }
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.

Maximized

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

RealtimeDisplayMode

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

RuntimeSerialNumber

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

ScreenRectangle

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

Size

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

TitleVisible

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

Methods

CaptureToBitmap

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

CaptureToBitmap

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

CaptureToBitmap

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

CaptureToBitmap

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

CaptureToBitmap

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

CaptureToBitmap

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

CaptureToBitmap

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

CaptureToBitmap

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

ClientToScreen

#Since v5.0
public Point ClientToScreen(Point clientPoint)
clientPoint (Point)

ClientToScreen

#Since v5.0
public Point2d ClientToScreen(Point2d clientPoint)
clientPoint (Point2d)

Close

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

CreateShadedPreviewImage

#Since v5.0
public bool CreateShadedPreviewImage(string imagePath, Size size, bool ignoreHighlights, bool drawConstructionPlane, bool useGhostedShading)
Creates a bitmap preview image of model.
imagePath (string)[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 (Size)[in] The width and height of the bitmap in pixels.
ignoreHighlights (bool)true if highlighted elements should be drawn normally.
drawConstructionPlane (bool)true if the CPlane should be drawn.
useGhostedShading (bool)true if ghosted shading (partially transparent shading) should be used.
true if successful.

CreateWireframePreviewImage

#Since v5.0
public bool CreateWireframePreviewImage(string imagePath, Size size, bool ignoreHighlights, bool drawConstructionPlane)
Creates a bitmap preview image of model.
imagePath (string)[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 (Size)[in] The width and height of the bitmap in pixels.
ignoreHighlights (bool)true if highlighted elements should be drawn normally.
drawConstructionPlane (bool)true if the CPlane should be drawn.
true if successful.

Equals

#
public override bool Equals(object obj)
obj (object)
Object.Equals

FromRuntimeSerialNumber

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

GetHashCode

#
public override int GetHashCode()

MouseCaptured

#Since v6.0
public bool MouseCaptured(bool bIncludeMovement)
Returns whether or not the mouse is captured in this view.
bIncludeMovement (bool)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
public void Redraw()
Redraws this view.
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.

ScreenToClient

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

ScreenToClient

#Since v5.8
public Point2d ScreenToClient(Point2d screenPoint)
screenPoint (Point2d)

ShowToast

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

ShowToast

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

ShowToast

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

SpeedTest

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

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
public static event EventHandler<ViewEnableDrawingEventArgs> EnableDrawingChanged
Called when the state of EnableDrawing changes.

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