Lua 関数の GetUIChannelIndex は、指定された2つのインデックス番号にマッチするUIチャンネルのインデックス番号を返します。
この例では、現在のセレクションにある最初のフィクスチャの Dimmer アトリビュートに対するUIチャンネル・インデックスを出力しています。
return function()
-- Get the Attribute index and UIChannel indexes
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 went wrong, maybe your first selected fixture don't have a Dimmer - Please try again")
return
end
Printf("The UI Channel Index is " .. uiChannelIndex)
end