FirstDmxModeFixture(handle)
Description
Section titled “Description”The FirstDmxModeFixture Lua function returns a handle to the first fixture matching the supplied DMX mode.
Arguments
Section titled “Arguments”- Handle:
This must be a handle to a DMX mode.
Return
Section titled “Return”- Handle:
The returned handle to the first fixture matching the DMX mode.
Example
Section titled “Example”If it exists, this example prints the data connected to the first “Dimmer” fixture using “Mode 0” - if the fixture type exists in the show. It uses the Dump() functions:
Dump()
Section titled “Dump()”The Dump() function returns a string with information about the object, for instance, the name, class, path of the object, its properties, and children.
Learn more in the Dump() topic.
| Copy CodeLua |
| ``` |
| return function () |
-- Get the handle for the Dimmer fixture.local fixtureTypeHandle = Patch().FixtureTypes['Dimmer']
-- Check if fixture type returned something and provide feedback.if fixtureTypeHandle == nil then ErrPrintf("The fixture type does not exist in this show. Try adding it or edit this plugin.")else -- Get the handle for the DMX mode of a Dimmer fixture. local fixtureDMXMode = fixtureTypeHandle.DMXModes["Mode 0"]
-- Check if fixtureDMXMode returned something and provide feedback. if fixtureDMXMode == nil then ErrPrintf("The fixture type does not contain a 'Mode 0' DMX mode. Try adding it or edit this plugin.") else -- Dumps information about the first fixture matching the DMX mode. Printf("=============== START OF DUMP ===============") FirstDmxModeFixture(fixtureDMXMode):Dump() Printf("================ END OF DUMP ================") endendend