pymel.core.windows.radioCollection

radioCollection(*args, **kwargs)

This command creates a radio button collection. Collections are parented to the current default layout if no parent is specified with the -p/parentflag. As children of the layout they will be deleted when the layout is deleted. Collections may also span more than one window if the -gl/globalflag is used. In this case the collection has no parent and must be explicitly deleted with the deleteUIcommand when it is no longer wanted.

Flags:

Long Name / Short Name Argument Types Properties
collectionItemArray / cia bool ../../../_images/query.gif
  Return a string list giving the long names of all the items in this collection.
defineTemplate / dt unicode ../../../_images/create.gif
  Puts the command in a mode where any other flags and args are parsed and added to the command template specified in the argument. They will be used as default arguments in any subsequent invocations of the command when templateName is set as the current template.
exists / ex bool ../../../_images/create.gif
  Returns whether the specified object exists or not. Other flags are ignored.
gl / gl bool ../../../_images/create.gif ../../../_images/query.gif
  Set the collection to have no parent layout. Global collections must be explicitly deleted.
numberOfCollectionItems / nci bool ../../../_images/query.gif
  Return the number of items in this collection.
parent / p unicode ../../../_images/create.gif
  The parent of the collection. The collection will be deleted along with the parent.
select / sl unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Select the specified collection item. If queried will return the name of the currently selected collection item.
useTemplate / ut unicode ../../../_images/create.gif
  Force the command to use a command template other than the current one. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.radioCollection

Example:

import pymel.core as pm

pm.window()
# Result: ui.Window('window1') #
pm.columnLayout( adjustableColumn=True, rowSpacing=10 )
# Result: ui.ColumnLayout('window1|columnLayout74') #
pm.frameLayout( label='Colors' )
# Result: ui.FrameLayout('window1|columnLayout74|frameLayout19') #
pm.columnLayout()
# Result: ui.ColumnLayout('window1|columnLayout74|frameLayout19|columnLayout75') #
collection1 = pm.radioCollection()
rb1 = pm.radioButton( label='Red' )
rb2 = pm.radioButton( label='Blue' )
rb3 = pm.radioButton( label='Green' )
pm.setParent( '..' )
# Result: u'window1|columnLayout74|frameLayout19' #
pm.setParent( '..' )
# Result: u'window1|columnLayout74' #

pm.frameLayout( label='Position' )
# Result: ui.FrameLayout('window1|columnLayout74|frameLayout20') #
pm.columnLayout()
# Result: ui.ColumnLayout('window1|columnLayout74|frameLayout20|columnLayout76') #
collection2 = pm.radioCollection()
rb4 = pm.radioButton( label='Top' )
rb5 = pm.radioButton( label='Middle' )
rb6 = pm.radioButton( label='Bottom' )
pm.setParent( '..' )
# Result: u'window1|columnLayout74|frameLayout20' #
pm.setParent( '..' )
# Result: u'window1|columnLayout74' #

pm.radioCollection( collection1, edit=True, select=rb2 )
# Result: ui.RadioCollection('window1|columnLayout74|frameLayout19|columnLayout75|radioCollection2') #
pm.radioCollection( collection2, edit=True, select=rb6 )
# Result: ui.RadioCollection('window1|columnLayout74|frameLayout20|columnLayout76|radioCollection3') #
pm.showWindow()