X3DObjectCollection.GetAsText
 
 
 

X3DObjectCollection.GetAsText

Introduced

v5.0

Description

Returns the X3DObjectCollection as a string formatted as a comma-separated list of item.

C# Syntax

String X3DObjectCollection.GetAsText();

Scripting Syntax

oString = X3DObjectCollection.GetAsText();

Return Value

String

Examples

1. Python Example

# 
#       This example logs all children under the scene root
#
from win32com.client import constants as c
Application.NewScene( "", 0 )
root = Application.ActiveSceneRoot
# Set the scene up
root.AddGeometry( "Cone", "NurbsSurface" )
root.AddGeometry( "Torus", "MeshSurface" )
root.AddGeometry( "Disc", "MeshSurface" )
root.AddGeometry( "Disc", "NurbsSurface" )
root.AddGeometry( "Cube", "NurbsSurface" )
# Get an X3DCollection
xc = Application.ActiveSceneRoot.FindChildren()
Application.LogMessage( Application.ClassName(xc) )
# Find all nurbs primitives in the collection
nrbs = xc.Filter( c.siSrfMeshPrimType )
Application.LogMessage( nrbs.GetAsText() )
# Expected result:
#INFO : X3DObjectCollection
#INFO : cone,disc1,cube

2. JScript Example

/* 
        This example logs all children under the scene root
*/
NewScene( null, false );
var root = Application.ActiveSceneRoot;
// Set the scene up
root.AddPrimitive( "Square" );
root.AddGeometry( "Disc", "MeshSurface" );
root.AddGeometry( "Disc", "MeshSurface" );
root.AddGeometry( "Cube", "MeshSurface" );
// Get an X3DCollection
var kids = Application.ActiveSceneRoot.FindChildren();
Application.LogMessage( Application.ClassName(kids) );
// Find all discs in the collection
var discs = kids.Filter( siDiscPrimType );
Application.LogMessage( discs.GetAsText() );
// Expected result:
//INFO : X3DObjectCollection
//INFO : disc,disc1

3. VBScript Example

'
' This example logs all children under the scene root
'
NewScene , false
set sr = Application.ActiveSceneRoot
' Set the scene up
sr.AddPrimitive "Arc"
sr.AddPrimitive "Arc"
sr.AddGeometry "Cone"
sr.AddNull
' Get an X3DCollection
set x3dc = Application.ActiveSceneRoot.FindChildren()
Application.LogMessage TypeName(x3dc)   
' Find all arc primitives in the collection
set arcs = x3dc.Filter(siArcPrimType)
Application.LogMessage arcs.GetAsText()
' Expected result:
'INFO : X3DObjectCollection
'INFO : arc,arc1