GetVarByName
Returns the reference to the variable which has the specified name.
Syntax
GetVarByName(doc, name)
Parameters
Parameter |
Type |
Description |
---|---|---|
doc |
documentReference |
Reference to the document |
name |
string |
Variable name |
Return
Returns the reference to the variable which has the specified name.
Note
You can also use doc[name]
notation to get the variable by name. For example, instead of
start = nex.GetVarByName(doc, "TrialStart")
you can use
start = doc["TrialStart"]
Examples
Python
import nex
doc = nex.GetActiveDocument()
# get the variable with the name TrialStart
start = nex.GetVarByName(doc, "TrialStart")
NexScript
doc = GetActiveDocument()
% get the variable with the name TrialStart
start = GetVarByName(doc, "TrialStart")