GetAttributeIndex(string)

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » GetAttributeIndex(string) Version 2.2

説明

GetAttributeIndex 関数は、アトリビュートのシステム名に基づいて Attribute Definition のインデックス番号(0ベース)を返します。

引数

  • string:
    アトリビュートのシステム名を表す文字列です。

戻り値

  • integer:
    指定したアトリビュートのインデックス番号を返します。

アトリビュートのインデックス番号が存在する場合、それを Command Line History に出力します。

Lua
return function()
    -- store the returned index or nil of "Gobo1"
    local attributeIndex = GetAttributeIndex("Gobo1")
    -- Check if the returned value is not nil and print a useful feedback
    if attributeIndex~=nil then
        Printf("Attribute is index number %i", attributeIndex)
    else
        Printf("The attribute is not found")
    end
end