Accessing a Constant or a Variable in an Ansys EnSight Software Script

How to access a constant or a variable in an Ansys EnSightâ„¢ simulation data visualization software script?

In order to access a constant or a variable, it must be active. In the GUI you activate it by checking the activation box in the "tree". From a script you do the same by using
ensight.variables.activate("Name_of_constant_or_variable")

In the next step, you can then access it with
ensight.ensvariable("Name_of_constant_or_variable")[0]

For transient cases, it's only necessary to activate the variable once. Then access it from within a loop over all time steps.