Description Returns the array data for a 2D grid type Analysis Results Node (ARN).
Syntax ARNGetDataAsDoubleArray nNodeNum, data
Parameters nNodeNum As Long Node number of existing ARN whose data array is being retrieved.
data() As Double After the function executes, the data() array is populated with the array values from the ARN. The data() array does not need to be explicitly dimensioned prior to being passed into the function call.
Example The example below defines a custom Function called ARNDivide whose input arguments, in_arn1 and in_arn2, are the node numbers of two ARNs. The function performs a cell-wise division of the two arrays and stores the resulting data in the ARN referenced by in_arn1.
Function ARNDivide( ByVal in_arn1 As Long, ByVal in_arn2 As Long ) As Boolean
'Performs a cell-wise division of in_arn1 / in_arn2 'Assumes both ARNs are same dimensionality 'Result stored in in_arn1
Dim data1() As Double, data2() As Double, adim As Long, bdim As Long ARNGetDataAsDoubleArray( in_arn1, data1() ) ARNGetDataAsDoubleArray( in_arn2, data2() ) adim = ARNGetAAxisDim( in_arn1 ) bdim = ARNGetBAxisDim( in_arn1 )
Dim curA As Long, curB As Long For curA = 0 To adim-1 For curB = 0 To bdim-1 data1(curA,curB) /= data2(curA,curB) Next Next
'Send data back to ARN ARNSetDataAsDoubleArray( in_arn1, data1() )
Return True
End Function
See Also
|