CmdObj()

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » CmdObj() Version 2.2

説明

The CmdObj Lua function returns information about the command line object.

引数

この関数は、引数を受け取りません。

戻り値

  • handle:
    The function returns a handle to the command line object.

This example uses the Dump() function on the command object. It lists all the properties and lists the children and some extra examples of how the command line object can be used:

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.

Lua
return function()
--Store the handle to the command object
local cmd = CmdObj()
--Print all information about the command object
Printf("=============== START OF DUMP ===============")
cmd:Dump()
Printf("================ END OF DUMP ================")
--Print some selected elements from the command object - this is currently not in the online manual
Printf("Current text in the command line: " ..cmd.cmdtext)
Printf("Current cmd edit object: " ..tostring(cmd.editobject and cmd.editobject:ToAddr()))
Printf("Current cmd destination: " ..tostring(cmd.destination and cmd.destination:ToAddr()))
Printf("Current user of the command line: " ..tostring(cmd.user and cmd.user:ToAddr()))
Printf("Current profile of the command line: " ..tostring(cmd.profile and cmd.profile:ToAddr()))
Printf("Current DMX readout: " ..cmd.dmxreadout)
Printf("Current amount steps: " ..cmd.maxstep)
Printf("Current selected object: " ..tostring(cmd:GetSelectedObject() and cmd:GetSelectedObject():ToAddr()))
end