Difference between revisions of "Instrument get"

From Sim Innovations Wiki
Jump to navigation Jump to search
(Created page with "== Description == '''instrument_id = instrument_get(uuid, )''' '''instrument_get''' is used to get a reference to an instrument. This function only works in a panel lua fil...")
 
 
Line 1: Line 1:
== Description ==
== Description ==


  '''instrument_id = instrument_get(uuid, )'''
'''instrument_id = instrument_get(uuid)'''
  '''instrument_id = instrument_get(uuid, offset)'''


'''instrument_get''' is used to get a reference to an instrument. This function only works in a panel lua file, and only instruments that are part of the panel can be retrieved.
'''instrument_get''' is used to get a reference to an instrument. This function only works in a panel lua file, and only instruments that are part of the panel can be retrieved.

Latest revision as of 11:15, 22 October 2018

Description

instrument_id = instrument_get(uuid)
instrument_id = instrument_get(uuid, offset)

instrument_get is used to get a reference to an instrument. This function only works in a panel lua file, and only instruments that are part of the panel can be retrieved.

Return value

Argument Type Description
instrument_id ID This value can be used for further reference. Functions such as visible can use this instrument_id. Its good practice to store this instrument_id in your logic code.

Arguments

# Argument Type Description
1 uuid String The UUID string for the instrument.
2 offset Number (Optional) Offset when multiple instruments of the same type are part of the panel.

Example

id = instrument_get("fd2f89a1-59ec-416f-8f28-e5b8bf4c1cbc")

if id ~= nil then
  -- Make the instrument invisible
  visible(id, false)
else
  print("Could not find instrument")
end