Go to: Synopsis. Return value. MEL examples.

Synopsis

renameSelectionList(string $newName)

Renames all the writable objects on the selection list using the string argument as the base name. For multiple selected objects an incremented value will be appended to the argument name.

Note this procedure does not work if any of the items in the selection list have the same child name. For example, group1|child and group2|child both have the same child name. Attempting to use this procedure with those items in the selection list will generate an error stating more than one object matches the child name.

Return value

None

Arguments

Variable Name Variable Type Description
$newNamestringName for the objects in the selection list. Must not be an empty string. Valid names begin with a letter or underscore, followed by letters, digits or underscores.

MEL examples

	//	Create a few objects. Select one and rename it.
	//
	$cone1 = `cone`;
	$cone2 = `cone`;
	$cone3 = `cone`;
	select $cone1;
	renameSelectionList("Cone");

	//	Add the other objects to the selection list and rename
	//	them all.
	//
	select -add $cone2;
	select -add $cone3;
	renameSelectionList("Object");