Setting global variables

Wed 24. May 2017, 16:34

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.
tcarter
 
Posts: 14
Joined: Wed 19. Apr 2017, 22:08

Re: Setting global variables

Wed 7. Jun 2017, 18:06

I hear that version 3.1 has addressed this somehow. Can I get details on that?
tcarter
 
Posts: 14
Joined: Wed 19. Apr 2017, 22:08

Re: Setting global variables

Thu 8. Jun 2017, 09:50

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/
User avatar
[Articy] Peter Sabath
Articy Staff
Articy Staff
 
Posts: 89
Joined: Wed 23. Nov 2011, 13:58
Location: Bochum

Re: Setting global variables

Thu 8. Jun 2017, 20:46

Okay, I got it to work with:
Code: Select all
newVar[ObjectPropertyNames.StringValue] = "Foo";
tcarter
 
Posts: 14
Joined: Wed 19. Apr 2017, 22:08

Return to articy:draft Macro Devkit

Who is online

Users browsing this forum: No registered users and 6 guests

Who We Are
Contact Us
Social Links