Selecting a List of Items

 
 
 
// C++ API
Application app;
Model root = app.GetActiveSceneRoot();
X3DObject myGrid;
root.AddGeometry( L"Grid", L"NurbsSurface", L"myGrid", myGrid );
X3DObject myCylinder;
root.AddGeometry( L"Cylinder", L"MeshSurface", L"myCylinder", myCylinder );
Selection sel( app.GetSelection() );
sel.SetAsText( L"myGrid,myCylinder" );

// C#
CXSIApplication app = new CXSIApplication();
Model root = app.ActiveSceneRoot;
X3DObject myGrid = root.AddGeometry("Grid", "NurbsSurface", "myGrid");
X3DObject myCylinder = root.AddGeometry("Cylinder", "MeshSurface", "myCylinder");
Selection sel = app.Selection;
sel.SetAsText(myGrid.Name + "," + myCylinder.Name);

// JScript
var myGrid = ActiveSceneRoot.AddGeometry( "Grid", "NurbsSurface" );
var myCylinder = ActiveSceneRoot.AddGeometry( "Cylinder", "MeshSurface" );
Selection.SetAsText( myGrid + "," + myCylinder );

' VBScript
set myGrid = ActiveSceneRoot.AddGeometry( "Grid", "NurbsSurface" )
set myCylinder = ActiveSceneRoot.AddGeometry( "Cylinder", "MeshSurface" )
Selection.SetAsText myGrid & "," & myCylinder

# Python
app = Application
myGrid = app.ActiveSceneRoot.AddGeometry( "Grid", "NurbsSurface" )
myCylinder = app.ActiveSceneRoot.AddGeometry( "Cylinder", "MeshSurface" )
app.Selection.SetAsText( "%s,%s" %(myGrid.Name,myCylinder.Name) )

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License