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.
Return
Section titled “Return”- 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