Selection.Item

Description

Returns the element at the specified key in the Selection. If the element is a 3d object, an X3DObject is returned. If the element is a subcomponent, then a CollectionItem is returned.

C# Syntax

// get accessor
Object Selection.get_Item( Object in_Key );

Parameters

Parameter Type Description
Key String or Integer Item name if the key is a String; otherwise, position of the item in the selection.

Examples

1. VBScript Example

' This example prints all the items in the 
' Selection, according to their position
SelectAll
dim oSelection, i
set oSelection = Application.Selection
for i = 0 to (oSelection.Count - 1)
	Application.LogMessage oSelection(i).Name
next
' OUTPUT:
'INFO : "Camera_Root"
'INFO : "Camera"
'INFO : "Camera_Interest"
'INFO : "light"

2. VBScript Example

' This example gets an item in the 
' Selection according to its name
SelectAll
set oSelection = Application.Selection
set oCam = oSelection.Item("Camera_Root")
LogMessage typename(oCam)
for each oParam in oCam.Parameters
	LogMessage oParam.FullName
next
' OUTPUT
'INFO : "CameraRig"
'INFO : "Camera_Root.Name"
'INFO : "Camera_Root.kine.local.blendweight"
'INFO : "Camera_Root.kine.local.active"
'INFO : "Camera_Root.kine.local.posx"
'INFO : "Camera_Root.kine.local.posy"
'INFO : "Camera_Root.kine.local.posz"
'INFO : "Camera_Root.kine.local.rotx"
'INFO : "Camera_Root.kine.local.roty"
'INFO : "Camera_Root.kine.local.rotz"
'INFO : "Camera_Root.kine.local.quatw"
'INFO : "Camera_Root.kine.local.quatx"
'INFO : "Camera_Root.kine.local.quaty"
'INFO : "Camera_Root.kine.local.quatz"
'INFO : "Camera_Root.kine.local.sclx"
'INFO : "Camera_Root.kine.local.scly"
'INFO : "Camera_Root.kine.local.sclz"
'INFO : "Camera_Root.kine.local.sclorix"
'INFO : "Camera_Root.kine.local.scloriy"
'INFO : "Camera_Root.kine.local.scloriz"
'INFO : "Camera_Root.kine.local.cnsscl"
'INFO : "Camera_Root.kine.local.cnsori"
'INFO : "Camera_Root.kine.local.cnspos"
'INFO : "Camera_Root.kine.local.affbyscl"
'INFO : "Camera_Root.kine.local.affbyori"
'INFO : "Camera_Root.kine.local.posxmaxactive"
'INFO : "Camera_Root.kine.local.posxminactive"
'INFO : "Camera_Root.kine.local.posymaxactive"
'INFO : "Camera_Root.kine.local.posyminactive"
'INFO : "Camera_Root.kine.local.poszmaxactive"
'INFO : "Camera_Root.kine.local.poszminactive"
'INFO : "Camera_Root.kine.local.rotxmaxactive"
'INFO : "Camera_Root.kine.local.rotxminactive"
'INFO : "Camera_Root.kine.local.rotymaxactive"
'INFO : "Camera_Root.kine.local.rotyminactive"
'INFO : "Camera_Root.kine.local.rotzmaxactive"
'INFO : "Camera_Root.kine.local.rotzminactive"
'INFO : "Camera_Root.kine.local.siscaling"
'INFO : "Camera_Root.kine.local.rotorder"