pymel.core.windows.renameUI

static windows.renameUI(*args, **kwargs)

This command renames the UI object passed as first arument to the new name specified as second argument. If the new name is a duplicate, or not valid, then re-naming fails and the old name is returned.

Derived from mel command maya.cmds.renameUI

Example:

import pymel.core as pm

#    Create a window with a single button.
#
window = pm.window()
pm.columnLayout()
# Result: ui.ColumnLayout('window1|columnLayout10') #
pm.button( 'exampleButton', label='Example' )
# Result: ui.Button('window1|columnLayout10|exampleButton') #
pm.showWindow( window )

#    Edit the button label.
#
pm.button( 'exampleButton', edit=True, label='New Label' )
# Result: ui.Button('columnLayout10|exampleButton') #

#    Rename the button.
#
pm.renameUI( 'exampleButton', 'newButton' )
# Result: u'newButton' #

#    Query the button label using the new object name.
#
pm.button( 'newButton', query=True, label=True )
# Result: u'New Label' #

Previous topic

pymel.core.windows.rangeControl

Next topic

pymel.core.windows.renderWindowEditor

Core

Core Modules

Other Modules

This Page