## AddToSelection

### Introduced

v1.0

### Description

Adds elements to the current selection.
Note: If the SelectionList argument contains an error, the command fails.

### Scripting Syntax

    AddToSelection( SelectionList, [HierarchyLevel], [CheckObjectSelectability] );

### Parameters

Parameter | Type | Description
--- | --- | ---
SelectionList | String | List of elements to add to the selection. Default Value: n/a
HierarchyLevel | String | Specifies how to select objects in a hierarchy. Default Value: "ASITIS"
Possible Values: | Description:
ASITIS | Select the object as it is.
NODE | Select the object.
BRANCH | Select the object and its children.
TREE | Select the entire hierarchy of objects.
MODEL | Select the model and the hierarchy of objects.
CheckObjectSelectability | Boolean | Specifies whether to select objects that marked as unselectable. Default Value: False
Possible Values: | Description:
False | Select objects even if they are marked as unselectable.
True | Do not select objects if they are marked as unselectable.

### Examples

#### 1. VBScript Example

    '

    ' The following uses "AddToSelection" to add an object (ie: "cylinder")

    ' to the selection list

    '

    NewScene

    CreatePrim "Cylinder", "MeshSurface"

    CreatePrim "Cylinder", "MeshSurface"

    Translate , 3.48352677058841, 0.127331217177334, -1.27331217177334E-02, _

    	siRelative, siView, siObj, siXYZ, , , siXYZ

    AddToSelection "cylinder"

    Application.LogMessage "object called cylinder should now be part of the selection list"

#### 2. VBScript Example

    '

    ' The following uses "AddToSelection" to add an object (ie: "cone")

    ' to the selection as a branch selected element.

    '

    NewScene

    CreatePrim "Cone", "MeshSurface"

    CreatePrim "Cylinder", "MeshSurface"

    Translate , -0.118156772275078, -5.87851913444323, 0.587851913444323, _

    	siRelative, siView, siObj, siXYZ

    ParentObj "cone", "cylinder"

    DeselectAll

    AddToSelection "cone", "BRANCH"

    Application.LogMessage "The object cone should now be branch selected"

    Application.LogMessage "The cylinder child should be highlighted in gray to reflect this."

### See Also

Selection SelectObj RemoveFromSelection SelectBranch SelectTree SelectModel