Skip to content

GetAttributeIndex

Anthony Headley edited this page May 4, 2020 · 2 revisions

GetAttributeIndex(string:attributeName) : int

Brief:

Returns an attribute index given it's name

Paramiters:

Name Type Description Optional
attributeName string An attribute name found in Menu > Patch > Attribute Definations

Returns:

Type Description
int index
nil if attribute does not exists

Note that the attribute index is a zero based version of the Menu > Patch > Attribute Definations Number. also it does not look up the Pretty name. A Attribute may not exits until a fixture with that attribute is patched.

Examples:

Echo(GetAttributeIndex('Dimmer'))       -- 0
Echo(GetAttributeIndex('Pan'))          -- 1
Echo(GetAttributeIndex('Color1'))       -- 56
local x = GetAttributeIndex('Color 1')  -- x == nil
Clone this wiki locally