In FlexScript, you can store a node in a variant:
var myNode = node("someNode", model()); To store that value in a treenode (or as a cell in a table), you would use nodepoint(nodeadddata(theNode, DATATYPE_COUPLING), myNode). Bundles currently only support number and string data, so they don't store Variants or nodes.
Labels are a special case. The setlabel and getlabel commands can handle any kind of Variant, including arrays. If you use setlabel, FlexSim will set the datatype of the node to handle whatever variant you give it. For example, if the Variant used in setlabel represents a number, the label node will get number data. If the Variant used in setlabel represents a string, the label node with get string data.
If the Variant used in setlabel is an array, it gets slightly more complicated. The label node is given simple data, a reduced version of object data. That simple data then stored the variant value. This happens for any array type.
If you use getlabel to retrieve the value of a label node, FlexSim will analyze the node, and return a Variant of the correct type.
This means you use can use setlabel and getlabel to work with variants of any type (number, string, node, intarray, doublearray, treenodearray, stringarray).
.
Jordan Johnson
Principal Software Engineer
>