MAXScript Language Reference > 3ds Max Objects > Interfaces > Core Interfaces > Core Interfaces Documentation > U,V,W,X,Y,Z >

# Interface: xViewChecker

Interfaces > Core Interfaces > xViewChecker

| Viewport Shading - Quick Navigation | Core Interfaces - Quick Navigation

The xViewChecker Core Interface introduced in 3ds Max 2010 exposes properties and methods for interacting with the xView Geometry Checker feature.

Properties:

    xViewChecker.on : bool : Read|Write

Enable/Disable the xView Checker.

    xViewChecker.activeIndex : index : Read|Write

Get/Set the index of the active xView Checker.

    xViewChecker.seeThrough : bool : Read|Write

Get/Set the state of the See-Through option of the xView Checker.

    xViewChecker.autoUpdate : bool : Read|Write

Get/Set the state of the Auto Update option of the xView Checker. When set to true, the xView Checked will update automatically.

    xViewChecker.displayTextUpTop : bool : Read|Write

Get/Set the Display On Top option of the xView Checker.

Methods:

    <integer>xViewChecker.getNumCheckers()

Returns the number of registered xView Checkers.

    <TSTR>xViewChecker.getCheckerName <index>index

Returns the name of the indexed xView Checker.

    <DWORD>xViewChecker.getCheckerID <index>index

Returns the ID of the indexed xView Checker.

    <DWORD>xViewChecker.getActiveCheckerID()

Returns the ID of the active xView Checker.

    <void>xViewChecker.setActiveCheckerID <DWORD>ID

Activates the xView Checker with the given ID. If Checking is active, the xView Checker will become the active one.

    <bool>xViewChecker.doesCheckerHavePropDlg <index>index

Returns true if the indexed xView Checker has a properties dialog, false if it does not provide a properties dialog.

    <void>xViewChecker.showCheckerPropDlg <index>index

Displays the Properties dialog of the indexed xView Checker. The index is ZERO-based!

    <void>xViewChecker.popupMenuSelect()

Opens the xView Checker pop-up menu at the current mouse position.

    <void>xViewChecker.selectResults <time>time

Selects the results at the given time. This will set the vertex, edge or face selection of the checked geometry objects based on the checker results.

    <enum>xViewChecker.getCurrentReturnVal()

    getCurrentReturnVal enums: {#Failed|#Vertices|#Edges|#Faces}

Gets the current checker return value which can be one of the four possible name values corresponding to a Failed check or a successful vertex, edge or face check.

    <integer>xViewChecker.getCurrentOutputCount()

Returns the current output count. This is the number of sub-object elements (vertices, edges or faces) detected by the current checker to match its search criteria.

    <TSTR by value>xViewChecker.getCurrentString()

Returns the current string displayed by the checker in the top middle of the viewport. It could be used for logging checker results or displaying the results in alternative locations in the UI.

## Defining MAXScript Functions For Custom Geometry Checking

The following functions can be used to register custom MAXScript functions to implement user-defined xView Checkers not available in the list of shipping Checkers. They can also be used to run the checker, display theresults and unregister the Checker again.

Note

Registering a new xView Checker using MAXScript will cause the new checker to appear on the list of checker shown at the bottom of the viewport when another checker is active, but will NOT put the checker automatically in the Viewport Menu which contains regular MacroScripts exposing the xView Checkers to the 3ds Max Menu System as ActionItems.

You will have to define a new MacroScript to expose your custom xView to the Menu System and will have to add it to the xViews menu either manually or using MAXScript. See the fourth How To... tutorial for details.

    <bool>xViewChecker.unRegisterChecker <string>name

Unregisters the custom xView Checker with the given name.

    <index>xViewChecker.registerChecker <value>checkerFunc <value>isSupportedFunc <enum>type <string>name <value>popupDlgFunc <value>textOverrideFunc <value>displayOverrideFunc

    type enums: {#Failed|#Vertices|#Edges|#Faces}

Registers a xView Checker using custom MAXScript functions. When a function does not apply to the specific Checker, for example if no display override or text override is desired, the value of undefined can be passed as argument instead - the Checker will ignore the respective functionality in that case.

### checkerFunc

This is the custom MAXScript function which will be called to perform the check.

This function must expect three arguments - the time the check is performed at, the node to be checked and the by-reference array to store the results in. The array is passed empty and it is up to the function writer to implement the code that appends the indices of the sub-object elements considered for flagging to that array. That array will then be used by the display function (either the default one or a MAXScript displayOverride function) to highlight or select the specified sub-objects listed by index in the array.

The return result of the function is expected to be an integer as follows:

1: The results array contains vertex indices

2: The results array contains edge indices

3: The results array contains face indices

0 or any other value not listed above: The check failed, no results to display.

### isSupportedFunc

This is the custom MAXScript function which will be called to determine whether a selected node can be tested or not. It should return true if the test is applicable to the node or false if the node should not be tested.

### type

This is an enum which defines the sub-object type which will be tested/displayed.

Can be #Failed, #Vertices, #Edges or #Faces .

### name

This is a string defining the name of the test. It can be used to access the custom Geometry Checker later, unregister it or re-register it and so on.

### popupDlgFunc

This is a custom MAXScript function which can implement a custom setup dialog for the checker. If undefined is passed instead of a MAXScript function, no dialog button will be displayed for the Checker. It expects no arguments and does not have to return a specific value.

### textOverrideFunc

This is a custom MAXScript function which can return custom text to be displayed in the viewport next to the Checker's name. It should expect no arguments and return a string.

### displayOverrideFunc

This is a custom MAXScript function which can implement alternative display modes. If the value of undefined is passed instead of a MAXScript function, the default display methods of the Geometry Checker system will be used instead.

The function should expect four arguments - the time, the node, the window handle of the active viewport and the results array generated by the checker function.

This function can call the following method which uses almost the same arguments:

    <void>xViewChecker.displayResults <color>color <time>time <node>node <HWND>hwnd <enum>type <&index array>results

    type enums: {#Failed|#Vertices|#Edges|#Faces}
    results is In and Out parameter

Displays the results of the current Checker. This method can be used inside a custom displayOverride function to change the default checker display appearance, for example the colors to use, or what sub-object elements to highlight.

### color

defines the color to display the results in the viewport.

### time

defines the time at which the check was performed.

### node

defines the node to display the results for.

### hwnd

defines the window handle passed by the displayOverride function.

### type

defines thesub-object type to display, either #Failed, #Vertices, #Edges or #Faces .

### results

is the by-reference array with the 1-based indices of the sub-objects to display. Usually this is the results array created by the Geometry Checker MAXScript function.

    <void>xViewChecker.runCheck <time>time

Runs the xView Check at the current time. This can be used to perform the check and refresh the display.

For practical examples of using these methods, see the following How To... tutorials:

How To ... Develop A Face AreaxViewChecker - Part 1

How To... Develop A Face AreaxViewChecker - Part2

How To... Develop A Face AreaxViewChecker - Part3

How To ... Develop A Face Area xView Checker - Part 4

#### See Also

- xView Geometry Checker Access