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

Synopsis

radioCollection( [string] , [collectionItemArray=boolean], [defineTemplate=string], [exists=boolean], [gl=boolean], [numberOfCollectionItems=boolean], [parent=string], [select=string], [useTemplate=string])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

radioCollection is undoable, queryable, and editable.

This command creates a radio button collection. Collections are parented to the current default layout if no parent is specified with the -p/parent flag. 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/global flag is used. In this case the collection has no parent and must be explicitly deleted with the deleteUI command when it is no longer wanted.

Return value

stringFull path name to the collection.

In query mode, return type is based on queried flag.

Flags

collectionItemArray, defineTemplate, exists, gl, numberOfCollectionItems, parent, select, useTemplate
Long name (short name) Argument types Properties
exists(ex) boolean create
Returns true|false depending upon whether the specified object exists. Other flags are ignored.
defineTemplate(dt) string create
Puts a 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.
useTemplate(ut) string create
Force the command to use a command template other than the current one.
gl(gl) boolean createquery
Set the collection to have no parent layout. Global collections must be explicitly deleted.
parent(p) string create
The parent of the collection. The collection will be deleted along with the parent.
select(sl) string createqueryedit
Select the specified collection item. If queried will return the name of the currently selected collection item.
numberOfCollectionItems(nci) boolean query
Return the number of items in this collection.
collectionItemArray(cia) boolean query
Return a string list giving the long names of all the items in this collection.

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 have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

cmds.window()
cmds.columnLayout( adjustableColumn=True, rowSpacing=10 )
cmds.frameLayout( label='Colors' )
cmds.columnLayout()
collection1 = cmds.radioCollection()
rb1 = cmds.radioButton( label='Red' )
rb2 = cmds.radioButton( label='Blue' )
rb3 = cmds.radioButton( label='Green' )
cmds.setParent( '..' )
cmds.setParent( '..' )

cmds.frameLayout( label='Position' )
cmds.columnLayout()
collection2 = cmds.radioCollection()
rb4 = cmds.radioButton( label='Top' )
rb5 = cmds.radioButton( label='Middle' )
rb6 = cmds.radioButton( label='Bottom' )
cmds.setParent( '..' )
cmds.setParent( '..' )

cmds.radioCollection( collection1, edit=True, select=rb2 )
cmds.radioCollection( collection2, edit=True, select=rb6 )
cmds.showWindow()