値 > コレクション > コレクションのタイプ > SelectionSetArray 値 |
SelectionSetArray クラスには selectionSets というただ 1 つのインスタンスがあり、これは現在のシーン内にあるすべての名前付き選択セットの配列です。
名前付き選択セットは、3ds Max ツールバー内の[名前付き選択セット](Named Selection Set)ドロップダウン リストの選択セットに対応します。
SelectionSet 値はマップ可能です。
SelectionSet 値も参照してください。
コンストラクタ:
selectionSets
プロパティ
<selectionsetarray>.count : Integer, read-only
名前付き選択セットの数を返します。
演算子
<selectionsetarray>[<set_name>]
名前付き選択セット名を使ってコレクションのメンバにアクセスします。 set_name は、文字列値または名前値になります。
<selectionsetarray>[<set_index_integer>]
インデックス番号を使ってコレクションのメンバにアクセスします。インデックスは 1 から始まります。
<selectionsetarray>[<set_name>] = <node_array>
set_name (文字列値または名前値)という名前の名前付き選択セットを作成または置換します。 node_array はノードのアレイでなければなりません。
メソッド
deleteItem <selectionsetarray> [<set_name> | <selectionset>]
選択セットを削除します。最初の引数は、選択セットの配列 selectionSets です。
2 番目の引数は、選択セットの名前です。これは文字列、Name 値、選択セット自身(3ds Max 9 の新しいオプション) のいずれかです。
isDeleted() メソッドは、名前付き選択セットに対して 3ds Max 9 以降で有効です。詳細とサンプルは、SelectionSet 値 値を参照してください。
関連するメソッド
getNumNamedSelSets()
名前付き選択セットの数を整数で返します。
getNamedSelSetName <set_index>
インデックスで指定された名前付き選択セットの名前を文字列で返します。<set_index>の基数は 1 です。
getNamedSelSetItemCount <set_index>
インデックスで指定された名前付き選択セットのノードの数を整数で返します。<set_index> の基数は 1 です。
getNamedSelSetItem <set_index> <node_index>
インデックスで指定された名前付き選択セット内のインデックスで指定されたノードをノードで返します。<set_index>および<node_index>の基数は 1 です。
名前またはインデックスを持つ selectionSets 配列にインデックスを指定して、個々の選択セットにアクセスします。
例 |
set1 = selectionSets["my set 1"] |
このセットを MAXScript 内の選択、オブジェクト、ライトなどのオブジェクト セットを使うのと同様に使うことができ、次のようになります。
例 |
move set1 [10,0,0] --moves all the objects in the set across 10 in x. |
文字列または MAXScript 名(# で始まる)のどちらも selectionSets 配列のインデックスとして使うことができ、すべてのセットに対してループしたい場合は、整数をインデックスとして使うことができます。
例 |
selectionSets[#set2].wireColor = red for i in 1 to selectionSets.count do saveNodes selectionSets[i] ("set" + i as string + ".max") |
新しい名前付き選択セットの変更、追加、および削除を行うには、 selectionSets 配列の標準配列メソッドを使用します。
例 |
selectionSets["new set"] = selection --snap the current selection selectionSets["old spheres"] = $sphere* --all the current objects named "sphere*" selectionSets[#foo] = #(obj1, obj2, obj3) deleteItem selectionSets"old set" --delete the set named "old set" nss = selectionSets["another set"] --get the selection set by name deleteItem selectionSets nss --possible syntax since 3ds Max 9 |