Go to: Synopsis. Return value. Flags. MEL examples.

Synopsis

lsUI [-cmdTemplates] [-collection] [-contexts] [-controlLayouts] [-controls] [-dumpWidgets] [-editors] [-head int] [-long] [-menuItems] [-menus] [-numWidgets] [-panels] [-radioMenuItemCollections] [-tail int] [-type string] [-windows] [objects]

lsUI is undoable, NOT queryable, and NOT editable.

This command returns the names of UI objects.

Return value

string[] The names of the object arguments.

Flags

cmdTemplates, collection, contexts, controlLayouts, controls, dumpWidgets, editors, head, long, menuItems, menus, numWidgets, panels, radioMenuItemCollections, tail, type, windows
Long name (short name) Argument types Properties
-long(-l) create
Use long pathnames instead of short non-path names.
-head(-hd) int create
The parameter specifies the maximum number of elements to be returned from the beginning of the list of items. (Note: each flag will return at most this many items so if multiple flags are specified then the number of items returned will be greater than the value specified).
-tail(-tl) int create
The parameter specifies the maximum number of elements to be returned from the end of the list of items. (Note: each flag will return at most this many items so if multiple flags are specified then the number of items returned will be greater than the value specified).
-type(-typ) string createmultiuse
List all objects of a certain type specified by the string argument. For example, "window", "menu", "control", or "controlLayout".
-panels(-p) create
All currently existing panels.
-editors(-ed) create
All currently existing editors.
-windows(-wnd) create
Windows created using ELF UI commands.
-controls(-ctl) create
Controls created using ELF UI commands. [e.g. buttons, checkboxes, etc]
-controlLayouts(-cl) create
Control layouts created using ELF UI commands [e.g. formLayouts, paneLayouts, etc.]
-collection(-col) create
Control collections created using ELF UI commands.
-radioMenuItemCollections( -rmc) create
Menu item collections created using ELF UI commands.
-menus(-m) create
Menus created using ELF UI commands.
-menuItems(-mi) create
Menu items created using ELF UI commands.
-numWidgets(-nw) create
Reports the number of QT widgets used by Maya.
-dumpWidgets(-dw) create
Dump all QT widgets used by Maya.
-contexts(-ctx) create
Tool contexts created using ELF UI commands.
-cmdTemplates(-ct) create
UI command templates created using ELF UI commands.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

//    List all windows.
//
lsUI -windows;

//    List all panels and editors.
//
lsUI -panels -editors;

//    Use the -typ/type flag to list all controls and control layouts.
//    Alternatively, you could use the -ctl/controls and -cl/controlLayouts
//    flags.
//
lsUI -type control -type controlLayout;

//    Or...
//
lsUI -controls -controlLayouts;