Articy Forum


https://www.articy.com:443/forum/

Setting global variables

https://www.articy.com:443/forum/viewtopic.php?f=47&t=18202

Page 1 of 1

Setting global variables

Posted: Wed 24. May 2017, 16:34
by tcarter
How do I set global variables in code? I can make one of a particular type, but not sure how to set its value
Code: Select all
var testVarSet = Session.GetVariableSetByName("Test");
string newVarName = "Test_Blah";
var newVar = Session.CreateGlobalVariable(testVarSet, newVarName, VariableType.String);

I've tried things like newVar = "Foo" and newVar.SetText("Foo"), but they don't work, and calling newVar[ObjectPropertyNames.DefaultValue] = "Foo" crashes Articy.

Re: Setting global variables

Posted: Wed 7. Jun 2017, 18:06
by tcarter
I hear that version 3.1 has addressed this somehow. Can I get details on that?

Re: Setting global variables

Posted: Thu 8. Jun 2017, 09:50
by [Articy] Peter Sabath
The version 3.1 was released yesterday, you should have a notification in your articy:draft notification inbox.

Since this version comes with a new multi-user feature, it is required that you update both articy:server and articy:draft clients.

beside that you should also update the nuget package to version 1.2.0 to have the same assemblies for you compiler than those which are really used by articy:draft when loading the plugin.

https://www.nuget.org/packages/ArticyDraft3.MacroDevKit/

Re: Setting global variables

Posted: Thu 8. Jun 2017, 20:46
by tcarter
Okay, I got it to work with:
Code: Select all
newVar[ObjectPropertyNames.StringValue] = "Foo";

All times are UTC
Page 1 of 1