Selecting a Single Item (Adding to the Selection)

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

// C#
CXSIApplication app = new CXSIApplication();
Model root = app.ActiveSceneRoot;
X3DObject myGrid = root.AddGeometry("Grid", "NurbsSurface", "myGrid");
Selection sel = app.Selection;
sel.Add(myGrid, siSelectMode.siSelectDefault);

// JScript
var myGrid = ActiveSceneRoot.AddGeometry( "Grid", "NurbsSurface" );
Selection.Add( myGrid );

' VBScript
set myGrid = ActiveSceneRoot.AddGeometry( "Grid", "NurbsSurface" )
Selection.Add myGrid

# Python
app = Application
myGrid = app.ActiveSceneRoot.AddGeometry( "Grid", "NurbsSurface" )
app.Selection.Add( myGrid )

# Perl
my $app = $Application;
my $myGrid = $app->ActiveSceneRoot->AddGeometry( "Grid", "NurbsSurface" );
$app->Selection->Add( $myGrid );