v1.0
選択
現在選択されているエレメントを選択解除し、指定されたエレメントを選択します。
注: SelectionList 引数にエラーが含まれる場合、コマンドは失敗します。
InvertSelection( [SelFilter], [CheckComponentVisibility], [CheckObjectSelectability] ); |
| パラメータ | タイプ | 詳細 | ||||||
|---|---|---|---|---|---|---|---|---|
| SelFilter | FilterConstant | 選択するエレメントのタイプを指定する選択フィルタ。
デフォルト値:現在選択されているフィルタ |
||||||
| CheckComponentVisibility | siComponentVisibilityMode | コマンドを、表示されたコンポーネントにのみ適用するかどうかを指定します。
デフォルト値: siIgnoreComponentVisibility
|
||||||
| CheckObjectSelectability | ブール | 選択不可としてマーキングされたオブジェクトを選択するかどうかを指定します。
デフォルト値: False
|
NewScene
' Create some objects and an extra light to play with
CreatePrim "Cube", "MeshSurface"
Translate , -6, -0.995037190209989, 9.95037190209989E-02, siAbsolute, siView, siObj, siXYZ, True, , , , , , , , , 0
Scale , 0.46615087040619, 0.46615087040619, 0.46615087040619, siRelative, siGlobal, siObj, siXYZ, , , , , , , , 0
CreatePrim "Sphere", "MeshSurface"
Translate , 6, -0.995037190209989, 9.95037190209989E-02, siAbsolute, siView, siObj, siXYZ, True, , , , , , , , , 0
GetPrimLight "Infinite.Preset", "Infinite"
SelectObj "Cube,Infinite"
' Deselect all selected objects, and select all unselected objects
PrintSelection
InvertSelection "object"
PrintSelection
' Note that when you use a filter, everything that does not match the filter is unselected
' For example, this command inverts the selection status of all the lights, and unselects
' all other elements in the scene.
InvertSelection "light"
PrintSelection
' Invert the selection of some components
SetSelFilter "Vertex"
SelectGeometryComponents "cube.pnt[3,4]"
PrintSelection
InvertSelection "point"
PrintSelection
Sub PrintSelection
msg = "Selection:"
if Selection.count = 0 then
msg = msg & " <empty>"
else
for each obj in Selection
msg = msg & " " & obj
next
end if
logmessage msg
End Sub
|
NewScene ' Create a sphere, hide some polygons CreatePrim "Sphere", "MeshSurface" ActivatePolygonSelTool SelectGeometryComponents "sphere.poly[4,12,20,28,36,44,52,60]" ToggleVisibility ' Select the right half of the sphere. SelectGeometryComponents "sphere.poly[16-47]" ' Invert the poly selection, ignoring the fact that some of the polys are hidden MsgBox "Will now InvertSelection ignoring component visibility..." InvertSelection , siIgnoreComponentVisibility MsgBox "Notice some of the hidden polygons are selected" ' Invert the poly selection again, taking into account the fact that some of the polys are hidden MsgBox "Will now InvertSelection again, but checking component visibility..." InvertSelection , siCheckComponentVisibility MsgBox "Notice no hidden polygons are selected" |