How to get a handle by fixture ID

BECOME PART OF THE COMMUNITY - Sign up here
  • Hello. I'm a totally beginner in LUA please bear with me.
    I want to get a property value of property Name for my fixture 101.

    I found out there is a function Get(light_userdata:handle, string:property_name [,enum{Roles}:role]): string:property_value (if 'role' provided - always string)
    Could you please tell me how to use it.

    Thank you in advance

  • Code
    local fixture_name = ObjectList('fixture 101')[1].name
    
    or 
    
    local fixture_name = ObjectList('fixture 1')[1]:Get('name')

    Third argument for Get() is optional and allows you to get value in different "representations".

    So if we have some element (1) assigned to the layout 1, with X-coordinate -10, then with the regular

    Code
    local posx = DataPool().Layouts[1][1]:Get('posx')

    you will get "system" coordinate value 65526, but with

    Code
    local posx = DataPool().Layouts[1][1]:Get('posx',Enums.Roles.Display)

    you will get "-10", but as a string.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!