Navigation: Scripting Reference Manual > Functions & Subroutines > ARNSetDisplayScale

 

ARNSetDisplayScale

 

Contact Us: fredsupport@photonengr.com

 

Description

When multiple ARN are displayed in the visualization view, this subroutine allows specification of the color scaling to be applied to all of the displayed ARNs.  The intention of this command is to facilitate displaying multiple ARNs simultaneously in the visualization view with the same color scale.  For this command to have any effect, it must be called after ARNDisplayInVisualizationView() has been used to display one or more ARNs in the 3D view.

 

Syntax

ARNSetDisplayScale( arns(), rangeString )

 

Parameters

arns() As Long

Array containing the ARNs whose displayed data should use the color scaling specified by rangeString.  If a node in arns() is invalid, then the script halts with an error.  If a node in arns() is valid but is not currently being displayed in the visualization view, it will be ignored (it does not become visualized and is not included in the auto-scaling calculation).

 

rangeString As String

String of the form "min,max" or "Auto" that sets the corresponding minimum and maximum values of the color range.  Data values falling below the supplied min value will be assigned the lowest palette color. Data values falling above the supplied max value will be assigned the highest palette color.  When the "Auto" option is used, then the min,max data range is automatically determined from the data in all valid nodes of the arns() array.

 

Example

The following example performs a raytrace and then forms an array containing the node numbers of any Analysis Results Nodes (ARNs) that were created as a result of the raytrace and displays each one in the 3D viewer.  Lasly, all of the displayed ARNs are set to display using the same color range as determined by the "Auto" option of ARNSetDisplayScale().

 

Sub Main

 

    'Delete existing nodes and perform a new raytrace

    ARNDeleteAllNodes

    TraceCreate

    ClearOutputWindow

 

    'Create an array with all ARNs

    Dim nodes() As Long, i As Long, numArns As Long

    numArns = 0

    For i = 0 To ARNGetMaxNodeNum()

        If ARNIsValidNode(i) Then

 

            'Add valid ARN to an array

            numArns = numArns + 1

            ReDim Preserve nodes( numArns - 1 )

            nodes( numArns - 1 ) = i

   

            'Display the ARN with a legend

            ARNDisplayInVisualizationView(nodes(i), "WantLegend=True")

 

        End If

    Next i

 

    'Use Autoscaling to put all displayed ARNs onto a single color scale

    ARNSetDisplayScale(nodes, "Auto")

 

End Sub

 

See Also

All ARN Scripting Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC