Action with Attribute
action with attribute are actions that can store a value, display a value, or provide an input field for the user.
Possible different variants
There are the following variants
- Any
- String
- Double
- Bool
- Table
- Internal
These actions can be added by right-clicking on the module:
These differ only slightly and can still be changed afterward. The difference lies in the automatically generated code which is saved in the actions.
Although all values can be sent and displayed, no strings are stored in the internal processing, for example an int. This means that strings are saved as 0.00 in this case, this is only visible after a reload of the control core or a reopen of the PIXERA Project→ Control Core
After sendText() is triggered:
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/9741/direct/1720769267715/image.png)
After reload:
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/9741/direct/1720772480355/image.png)
Automatically generated code
If actions are generated automatically with attributes, they are generated with code. To do this, a variable is created which corresponds to the name of the variable:
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/9741/direct/1720772737758/image.png)
In this example, the variable “self._Var” is generated.
Values sent in to this action will be saved in “self._Var” which is a module wide variable.
The different types of variables generate different code.
Learn more about execAttribute()
Warning
It can lead to a problem if this generated variable uses the same name as other variables. It is up to the programmer to control this.
Info
The default is that if an action with attribute is executed manually with the button, no value is passed on in the node based system because the input is a nil value. If a new value is set, this is sent on to the node system
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/9741/direct/1721811444738/Animation32.gif)
val, doSet
These 2 parameters are generated automatically for actions with attributes.
The parameter val is the one that passes the data.
The parameter doSet is a bool which can decide whether this new value is also set. If False is specified for doSet, the action is triggered but no new value is saved.
INFO
The default parameter doSet is set to “true” if not specified
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/9741/direct/1721038078732/Animation1.gif)
This feature is used as an example if the current value should only be read out and not be overwritten, this is needed as an example by the UI Monitor Label.
Pixera 2.0.124 | 11. July 2024 | J.B.