GetNumRes
Returns the value of the specified cell in the Numerical Results Window of the first graphical view of the document.
Syntax
GetNumRes(doc, row, col)
Parameters
Parameter |
Type |
Description |
---|---|---|
doc |
documentReference |
Reference to the document |
row |
number |
1-based row number. |
col |
number |
1-based column number. |
Return
Returns the numeric value of the specified cell in the Numerical Results Window of the first graphical view of the document.
Note
In Python, you can also use NexDoc GetAllNumericalResults()
method. Using GetAllNumericalResults()
is much faster.
GetAllNumericalResults()
returns a list object with all the numerical results.
Each element of the list is a list containing values from a single column in Numerical Results table. For example:
import nex
doc = nex.GetActiveDocument()
nex.ApplyTemplate(doc, "PerieventHistograms")
allNumRes = doc.GetAllNumericalResults()
# allNumRes now contains a list object with all numerical results.
# for example, to get the 10-th value of the first column of numerical results, use allNumRes[0][9]
# thus, allNumRes[0][9] equals to the result of nex.GetNumRes(doc, 10, 1)
There is also GetNumResValue(row, col)
NexDoc method.
import nex
doc = nex.GetActiveDocument()
nex.ApplyTemplate(doc, "PerieventHistograms")
# get the value of the second bin of the first histogram
binCount = doc.GetNumResValue(2, 1)
Examples
Python
import nex
doc = nex.GetActiveDocument()
nex.ApplyTemplate(doc, "PerieventHistograms")
# get the value of the second bin of the first histogram
binCount = nex.GetNumRes(doc, 2, 1)
NexScript
doc = GetActiveDocument()
ApplyTemplate(doc, "PerieventHistograms")
% get the value of the second bin of the first histogram
binCount = GetNumRes(doc, 2, 1)