Navigation: Scripting Reference Manual > Functions & Subroutines > ARNGetCellIndicesClosestToLocation2D

 

ARNGetCellIndicesClosestToLocation2D

 

Contact Us: fredsupport@photonengr.com

 

Description

This subroutine retrieves the indices along the A and B axes of the ARN which are closest to designated physical location along the corresponding axes.  A boolean argument indicates whether the requested physical location lies outside of the A and B axis ranges.

 

 

Syntax

ARNGetCellIndicesClosestToLocation2D( arnNode, aLoc, bLoc, aInd, bInd, ob )

 

 

Parameters

arnNode As Long

The node number of the ARN being queried.

 

aLoc As Double

Location along the A axis whose closest index value is being retrieved.

 

bLoc As Double

Location along the B axis whose closest index value is being retrieved.

 

aInd As Long

Returned index position along the A axis whose center is closest to aLoc.

 

bInd As Long

Returned index position along the B axis whose center is closest to bLoc.

 

ob As Boolean

Returned boolean indicating whether the specified location lies outside of the bounds of either the A or B axis.

 

 

Example

The following script queries an ARN for the closest indices at a designated location and reports the index values or an out-of-bounds message.

Sub Main

 

    Dim arnNode As Long

    arnNode = ARNFindName( "Irradiance 1" )

 

    Dim aLoc As Double, bLoc As Double

    aLoc = 0.35

    bLoc = 0.21

 

    Dim aInd As Long, bInd As Long, ob As Boolean

    ARNGetCellIndicesClosestToLocation2D( arnNode, aLoc, bLoc, aInd, bInd, ob )

 

    If Not ob Then

        Print "Closest ARN index values are (" & aInd & ", " & bInd & ")"

    Else

        Print "Designated position is out of bounds."

    End If

 

End Sub

 

 

See Also

ARN Script Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC