Each visual object – that is, an object that is or can be part of a 2D diagram or 3D scene – has an internal and unique name. A “reference” to such an object is an Algosim object that contains such a name and thus serves as a reference to the visual object.
diagram function returns a reference to the diagram it selects and each function that creates a 2D chart or plot returns a reference to the newly created visual object.
scene function returns a reference to the scene it selects and each function that creates a 3D object or plot returns a reference to the newly created visual object.
When a reference is returned by an expression, the front end automatically displays the diagram or scene containing (or being) the referenced visual object.
References are ordinary (but opaque and immutable) Algosim objects and can be stored in variables. Hence, it is possible for a variable to contain a reference to a visual object that has been removed. If such a reference is returned by an expression, nothing happens.
A reference may contain references to other objects, typically “parts” of the object it is referring to. These are accessed using the
. operator (just like structure members).
For instance, if
d is a reference to a diagram, then
d.axes is a reference to its collection of axes, and
d.axes.x is a reference to its horizontal axis.