Skip to content

pytha.set_user_variable

daniel-flassig edited this page Jun 18, 2020 · 6 revisions

Create/set/delete a PYTHA user variable from within the plugin.

pytha.set_user_variable(name, value) 
Parameter Type Description
name string The name of the user variable. The name must be a valid lua identifier.
value number or string or nil New value of the variable

If the value is a string, then note that this string will be evaluated by the PYTHA input parser, when used. That means, a string "1 + 1" will result in a variable value 2. If the variable should contain a string value, the string must be surrounded by quotation marks, e.g.

pytha.set_user_variable("var", "\"the variable will contain a string\"")

See also:

pytha, set_element_attributes

Clone this wiki locally