SetAsText (Selection)

Description

Sets the selection by parsing a given string. SetAsText allows you to set the selection using the string path names for object names as is shown in the scripting history window. The string list is comma separated. You may use wildcards in the string to match many object for example "light*".

This is the equivalent of using the AddToSelection command with a list of objects.

Scripting Syntax

Selection.SetAsText( Text )

C# Syntax

Selection.SetAsText( String in_bstrText );

Parameters

Parameter

Type

Description

Text

String

Object names to convert to selection."

Examples

VBScript Example

set root = ActiveSceneRoot
root.AddGeometry "Cube", "MeshSurface", "myCube" 
root.AddGeometry "Grid", "NurbsSurface", "myGrid" 
root.AddGeometry "Cylinder", "MeshSurface", "myCylinder" 

set sel = Selection
sel.SetAsText "myCube,myGrid,myCylinder" 

LogMessage "Selection count: " & sel.Count 
'INFO : "Selection count: 3"

for each item in sel
LogMessage "Selection " & i & "= " & item.FullName
next

'INFO : "Selection 0= myCube"
'INFO : "Selection 1= myGrid"
'INFO : "Selection 2= myCylinder"

See Also

AddToSelection

Selection.Add

Selection.GetAsText



SOFTIMAGE|XSI v6.01     

Return to Softimage XSI Index