pymel.core.windows.deleteUI

deleteUI(*args, **kwargs)

This command deletes UI objects such as windows and controls. Deleting a layout or window will also delete all of its children. If a flag is used then all objects being deleted must be of the specified type. This command may not be edited or queried. NOTE: it is recommended that the type flags be used to disambiguate different kinds of objects with the same name.

Flags:
Long name (short name) Argument Types Properties
collection (cl) bool ../../../_images/create.gif
 
Object names for deletion are all radio or tool collections.
control (ctl) bool ../../../_images/create.gif
 
Object names for deletion are all controls.
editor (ed) bool ../../../_images/create.gif
 
Object names for deletion are all editors.
layout (lay) bool ../../../_images/create.gif
 
Object names for deletion are all layouts.
menu (m) bool ../../../_images/create.gif
 
Object names for deletion are all menus.
menuItem (mi) bool ../../../_images/create.gif
 
Object names for deletion are all menu items.
panel (pnl) bool ../../../_images/create.gif
 
Object names for deletion are all panels.
panelConfig (pc) bool ../../../_images/create.gif
 
Object names for deletion are panel configurations. Flag can have multiple arguments, passed either as a tuple or a list.
radioMenuItemCollection (ric) bool ../../../_images/create.gif
 
Object names for deletion are all radio menu item collections.
toolContext (tc) bool ../../../_images/create.gif
 
Object names for deletion are all tool contexts.
uiTemplate (uit) bool ../../../_images/create.gif
 
Object names for deletion are all UI templates.
window (wnd) bool ../../../_images/create.gif
 
Object names for deletion are all windows.

Derived from mel command maya.cmds.deleteUI

Example:

import pymel.core as pm

#    Example 1.
#
#    Create a simple window and then delete it and all of its children
#    with one 'deleteUI -window' command.
#
window = pm.window()
pm.paneLayout()
# Result: ui.PaneLayout('window1|paneLayout2') #
pm.button()
# Result: ui.Button('window1|paneLayout2|button13') #
pm.showWindow( window )

pm.deleteUI( window, window=True )
# Result: u'' #

#    Example 2.
#
#    Create a window with a number of buttons and delete a few of the
#    buttons with the 'deleteUI -control' command.
#
window = pm.window()
pm.columnLayout()
# Result: ui.ColumnLayout('window1|columnLayout24') #
pm.button()
# Result: ui.Button('window1|columnLayout24|button14') #
pm.button()
# Result: ui.Button('window1|columnLayout24|button15') #
pm.button()
# Result: ui.Button('window1|columnLayout24|button16') #
b1 = pm.button()
b2 = pm.button()
b3 = pm.button()
pm.showWindow( window )

pm.deleteUI( b1, b2, b3, control=True )
# Result: u'' #

Previous topic

pymel.core.windows.defaultNavigation

Next topic

pymel.core.windows.deviceEditor

Core

Core Modules

Other Modules

This Page