| スクリプト (MEL) |
MEL でのみ使用可能 |
executeForEachObject |
カテゴリ内: 言語, スクリプティング |
ジャンプ先: 概要. 戻り値. MEL 例.
string[] executeForEachObject( string $inThisList[], string $thisCmd )
このプロシージャは、オブジェクト名のリストを取得して、「thisCmd」のコマンドを各オブジェクトに適用します。オブジェクト名は、このコマンドでは %s で置き換えられます。
| このコマンドを適用可能な各オブジェクトに対して実行した結果の名前をすべて含む文字配列。 |
引数
// Example 1. if "thisCmd" is a string that looks like:
string $thisCmd = "reverseCommand -ch off -rpo on %s";
// and curve1 and curve2 are in the given list, then the commands
// that will be executed for each object will look like:
reverseCommand -ch off -rpo on curve1;
reverseCommand -ch off -rpo on curve2;
// Example 2. if "thisCmd" is a string that looks like:
string $thisCmd = "reverseProc( true, false, %s )";
// and curve1 and curve2 are in the given list, then the commands
// that will be executed for each object will look like:
reverseProc( true, false, "curve1" );
reverseProc( true, false, "curve2" );
// Example 3.
cone; sphere; select -all;
string $cmd = "duplicate %s";
string $itemList[] = `ls -sl`;
select -d;
string $results[] = executeForEachObject($itemList, $cmd);