Hi,
I'm trying to set an bunch of session variables with an script. however it seems that these get not set/updated.
When i init the var on page load it does set it, running the script doesn't update it. I'm i doing something wrong here?
Page settings:
Shape settings:
automation script snippet that should sets the variable:
for (int i = 1; i < 21; i++)
{
var number = i < 10 ? "SHUFF-A0" + i : "SHUFF-A" + i; // need to loop through all options and set all names// if the number matches the select shuffle
if (number == shf)
{
// use a different background color
engine.AddScriptOutput(UIVariables.CreateKey(number + "_background"), "#22282D");
engine.GenerateInformation(number + "_background" + ": #22282D");
}
else
{
engine.AddScriptOutput(UIVariables.CreateKey(number + "_background"), "#3B4F5A");
engine.GenerateInformation(number + "_background" + ": #3B4F5A");
}
}
The information events does show me all the expected names and values, they are not set / updated on my visio page however.
edit: i followed this example given here:
https://docs.dataminer.services/user-guide/Basic_Functionality/Visio/linking_shapes/Linking_a_shape_to_an_Automation_script.html#passing-automation-script-output-to-session-variables
Hi Gerwin,
I see in your code snippet that you use method UIVariables.CreateKey(...) instead of UIVariables.VisualOverview.CreateKey(...).
Right. i overlooked that since there is also the option for UIvariables.Createkey. 🙂