GetChannelFunctionIndex()
Description
Section titled “Description”The GetChannelFunctionIndex Lua function returns the integer matching a channel function based on two index inputs.
Arguments
Section titled “Arguments”- Integer:
The first integer is a UI Channel Index. This can be found in the Parameter List or by the GetUIChannelIndex() Lua function. - Integer:
This integer is an Attribute Index (0-based). This can be found in the Attribute Definitions or by the GetAttributeIndex() Lua function.
Return
Section titled “Return”- Integer:
The returned integer to a channel function.
Example
Section titled “Example”This example prints the indexes based on the fixture selection and the “Dimmer” attribute.
| Copy CodeLua |
| ``` |
| return function() |
-- Get the Attribute index and UIChannel index.local attributeIndex = GetAttributeIndex("Dimmer")local uiChannelIndex = GetUIChannelIndex(SelectionFirst(),attributeIndex)-- End the function if any of the index return nil.if (attributeIndex == nil or uiChannelIndex == nil) then ErrPrintf("Something wrong happened, maybe your first selected fixture don't have a Dimmer - Please try again") returnend-- Get the Channel Function Index and store it in a variable.local channelFunctionIndex = GetChannelFunctionIndex(uiChannelIndex,attributeIndex)Printf("The UIChannel Index is: %i. The Attribute Index is: %i. The Channel Function Index is: %i", uiChannelIndex, attributeIndex, channelFunctionIndex)end