GetUIChannelIndex(integer, integer)
Description
Section titled âDescriptionâThe GetUIChannelIndex Lua function returns the index integer matching a UI channel based on two index inputs.
Arguments
Section titled âArgumentsâ-
Integer:
The first integer is the patch index of a fixture. -
Integer:
This integer is an attribute index (0-based). This can be found in the Attribute Definitions or by the GetAttributeIndex() Lua function.Attribute Definition
Section titled âAttribute DefinitionâAttributes are the building blocks of fixture types. The same building blocks are used throughout the console and they are what is controlled using the Encoder bar when operating fixtures.
Attributes definitions describe the relation between Main Attributes and sub-attributes.
Learn more in the Attribute Definition topic.
GetAttributeIndex()
Section titled âGetAttributeIndex()âThe GetAttributeIndex Lua function returns the (0 based) index number of the attribute definition based on the system name of the attribute.
Learn more in the GetAttributeIndex() topic.
- Integer:
The returned integer to a channel function.
Example
Section titled âExampleâThis example prints the UI channel index of the âDimmerâ attribute of the first fixture in the current selection:
| Copy CodeLua |
| ``` |
| return function() |
-- Get the Attribute index and UIChannel indexeslocal attributeIndex = GetAttributeIndex("Dimmer")local uiChannelIndex = GetUIChannelIndex(SelectionFirst(),attributeIndex)-- End the function if any of the index return nilif (attributeIndex == nil or uiChannelIndex == nil) then ErrPrintf("Something went wrong, maybe your first selected fixture don't have a Dimmer - Please try again") returnendPrintf("The UI Channel Index is " .. uiChannelIndex)end