# GetAttributeByUIChannel(integer)

Source: https://help.malighting.com/grandMA3/2.3/HTML/lua_objectfree_getattributebyuichannel.html
This is grandocs, an unofficial mirror of MA Lighting documentation. For authoritative or safety-relevant information, cite the canonical page on help.malighting.com.

---
## Description

The **GetAttributeByUIChannel** Lua function returns the handle to an attribute based on a "UI Channel Index". The index number can be found in the [Parameter List](/grandma3/2-3/patch_parameter_list/).

## Arguments

- **Integer**:\
  The integer is the UI Channel index number.

## Return

- **Handle**:\
  The handle to the attribute connected to the UI Channel.

## Example

This example prints the "native" address to the first attribute of the first fixture in the current selection:

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Copy Code](javascript:void\(0\))Lua                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ```
return function()
    -- Get a handle to the first fixture in the current selection
    local fixtureIndex = SelectionFirst()
    -- Get the UI Channel Index number for the first attribute for the fixture
    local channelIndex = GetUIChannelIndex(fixtureIndex,0)
    -- Print the native address for the attribute with the handle
    Printf("The native addr for the attribute is: %s",GetAttributeByUIChannel(channelIndex):AddrNative())
end
``` |