ViewDisplayModeProperty

Returns or modifies a property of a display mode. Display mode properties are accessed by key/value.

To view all of the display mode keys, export a display mode to an INI-style file using either the ExportViewDisplayMode method, or by selecting, from within Rhino, Tools > Options > View > Display Modes and then clicking the Export button.

Open the resulting INI file in a text editor, such as Notepad, and you will see sections of text formatted similar to that of the following:

...

[DisplayMode\aae7be23-471f-4415-816f-f424a92139c4\View settings]

UseDocumentGrid=n

DrawGrid=n

DrawAxes=y

DrawZAxis=n

DrawWorldAxes=y

...

The first part of the section - Display\<display_mode_id> - identifies the display mode. In this example, the display mode is Wireframe. This portion of the section is not used when specifying a key.

The remaining portion of the section is concatenated together with the property name, separated by a backslash (\) character, to form the key.

For example, of one wanted to retrieve the UsesDocumentGrid property, you would specify following key:

Dim strKey, blnValue

strKey = "View settings\UseDocumentGrid"

blnValue = Rhino.ViewDisplayModeName("Wireframe", strKey)

Syntax

Rhino.ViewDisplayModeProperty (strMode, strKey [, vaValue])

Parameters

strMode

Required.  String.  The name or identifier of the display mode obtained from the ViewDisplayModes method.

strKey

Required.  String.  The display mode property key (see discussion above).

vaValue

Optional.  String.  The new value of the display mode property. Note, the data type must match.

Returns

Variant

If vaValue is not specified, then the current value of the display mode property. The possible value types returned are as follows

Type

Description

vbBoolean

True or False

vbInteger

An integer

vbLong

A long integer

vbDouble

A double-precision, floating-point number

vbString

A string

Color (vbLong)

An RGB color value

Point (vbArray)

A 3D point or 3D vector

Transform (vbArray)

A 4x4 transformation matrix

Variant

If vaValue is specified, then the previous value of the display mode property.

Null

If not successful, or on error.

Example

Dim strKey, blnValue

strKey = "Objects\Surfaces\ShowIsocurves"

blnValue = Rhino.ViewDisplayModeProperty("Shaded", strKey)

If blnValue = True Then

  Call Rhino.ViewDisplayModeProperty("Shaded", strKey, False)

End If

Also See

ViewDisplayMode

ViewDisplayModeEx

ViewDisplayModes