Instrument get

From Sim Innovations Wiki
Revision as of 13:15, 22 October 2018 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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