grandMA3 User Manual Publication

GetAttributeIndex(string)

grandMA3 User Manual » Plugins » Lua Functions - Object-Free API » GetAttributeIndex(string)
Version 2.0

Description

The GetAttributeIndex Lua function returns the (0 based) index number of the attribute definition based on the system name of the attribute.

Arguments

  • String:
    The string text of the attribute system name.

Return

  • Integer:
    The returned integer number represents the total amount of patched fixtures on all the stages in the show file.

Example

This example prints the index number of the attribute in Command Line History if it exists:

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