FindChild (X3DObject)
Description
Finds the first X3DObject child object of an X3DObject that matches a set of search criterias. The search is done recursively by default, the function returns the object that meet all supplied criterias i.e. name, type and family(ies). This function is typically used for retrieving an object if you know its type or name for instance.
Scripting Syntax
X3DObject.FindChild( [Name], [Type], [Family], [Recursive] )
C# Syntax
X3DObject X3DObject.FindChild( Object in_varName, String in_pbstrType, Object in_famArray, Boolean in_bRecursive );Parameters
|
Parameter |
Type |
Description |
|
Name |
A name expression or a CollectionItem, the expression can also contain wildcard characters. The name can be empty if the name is not required. |
|
|
Type |
The type of object defined by siType or an empty string if no type is used. The type can be a specific X3DObject type such as siModelType and si3DObjectType or a primitive type such as siPolyMeshType or siSrfMeshPrimType. If a primitive type is supplied, the function considers only the children objects defined with a primitive of this type. The valid types are listed below. Possible Values: • si3DObjectType: 3D Object type • siArcPrimType: Implicit Arc Primitive type • siAttractorCtrlType: Attractor Control Object type (electric force) • siCameraPrimType: Camera Primitive type • siCameraRootPrimType: Camera Root primitive type • siChainBonePrimType: Chain Bone Primitive type • siChainEffPrimType: Chain End Effector Primitive type • siChainRootPrimType: Chain Root Primitive type • siCirclePrimType: Implicit Circle Primitive type • siCloudPrimType: Cloud Primitive type • siConePrimType: Cone Primitive type • siCrvListAggregatePrimType: NURBS Curve List Aggregate Primitive type • siCrvListPrimType: NURBS Curve List Primitive type • siCubePrimType: Cube Primitive type • siCylinderPrimType: Cylinder Primitive type • siDiscPrimType: Disc Primitive type • siDodecahedronPrimType: Dodecahedron Primitive type • siDragCtrlPrimType: Drag Control Primitive type • siEddyCtrlPrimType: Eddy Control Primitive type • siFanType: Fan Force Object type • siFurPrimType: Fur Primitive type • siGeoShaderPrimType: GeoShader Primitive Type • siGravityCtrlType: Gravity Force Control Object type • siGridPrimType: Grid Primitive type • siIcosahedronPrimType: Icosahedron Primitive type • siLatticePrimType: Lattice Primitive type • siLightPrimType: Light Primitive type • siModelNullPrimType: Model Null Primitive type • siModelType: 3D Model type • siNullPrimType: Null Primitive type • siOctahedronPrimType: Octahedron Primitive type • siPolyMeshType: Polygon Mesh type • siSpherePrimType: Sphere Primitive type • siSpiralPrimType: Implicit Spiral Primitive type • siSpotInterestPrimType: Spot Interest Primitive type • siSpotRootPrimType: Spot Root Primitive type • siSquarePrimType: Implicit Square Primitive type • siSrfMeshPrimType: NURBS Surface Mesh Primitive type • siTetrahedronPrimType: Tetrahedron Primitive type • siTorusPrimType: Torus Primitive type • siTurbulenceCtrlPrimType: Turbulence Control Primitive type • siVolumeDeformType: Volume Deform type (implicit sphere volume) • siVortexCtrlType: Vortex Control Object type (magnetic force) • siWaveCtrlType: Wave Control Object type • siWindType: Wind Force Object type |
|
|
Family |
An array of families defined by siFamily or an empty array if none are required. The families are used for narrowing down the search, the array can contain X3DObject families like si3DObjectFamily or primitive families such as siNurbsSurfaceMeshFamily or siNullPrimitiveFamily. Only the children objects that match the supplied families are considered. If primitive families are supplied then only the objects defined with a primitive that belongs to one of them are considered. The valid families are listed below. Possible Values: • si3DObjectFamily: 3D Object family • siCameraFamily: Camera family • siChainElementFamily: Chain Element family • siControlObjectFamily: Control Object family • siCurveFamily: Curve Geometry family • siGeometryFamily: Geometry family • siGeometryShaderFamily: Geometry shader family • siImplicitGeometryFamily: Implicit Geometry family • siLatticeFamily: Lattice family • siLightPrimitiveFamily: Light Primitive family • siMeshFamily: Mesh Geometry family • siNullPrimitiveFamily: Null Primitive family • siNurbsCurveListFamily: Nurbs CurveList Geometry family • siNurbsSurfaceMeshFamily: Nurbs Surface Mesh Geometry family • siSurfaceCurveFamily: Surface Curve Geometry family • siSurfaceFamily: Surface Geometry family |
|
|
Recursive |
Recurse if True, otherwise the search is done on the immediate children. Default Value: True |
Return Value
Examples
VBScript Example
NewScene , false set oRoot = Application.ActiveProject.ActiveScene.Root oRoot.AddGeometry "Sphere", "MeshSurface", "mySphere" oRoot.AddGeometry "Cone", "MeshSurface", "myCone" oRoot.AddGeometry "Cone", "MeshSurface", "anotherCone" oRoot.AddGeometry "Cube", "NurbsSurface", "myCube" Application.LogMessage "** 1: Find the object whose name starts with 'Camera' **" set obj = oRoot.FindChild( "Camera*" ) Application.LogMessage "Found child: " & obj.Name Application.LogMessage "** 2: Find an object of type siLightPrimType **" set obj = oRoot.FindChild( "", siLightPrimType ) Application.LogMessage "Found child: " & obj.Name Application.LogMessage "** 3: Find an object that belongs to siMeshFamily family **" set obj = oRoot.FindChild( , , Array(siMeshFamily) ) Application.LogMessage "Found child: " & obj.Name Application.LogMessage "** 4: Find the object whose name start with 'an' and belongs to siMeshFamily family **" set obj = oRoot.FindChild("an*",,Array( siMeshFamily )) Application.LogMessage "Found child: " & obj.Name ' Expected results: 'INFO : ** 1: Find the object whose name starts with 'Camera' ** 'INFO : Found child: Camera_Root 'INFO : ** 2: Find an object of type siLightPrimType ** 'INFO : Found child: light 'INFO : ** 3: Find an object that belongs to siMeshFamily family ** 'INFO : Found child: mySphere 'INFO : ** 4: Find the object whose name start with 'an' and belongs to siMeshFamily family ** 'INFO : Found child: anotherCone
Autodesk Softimage v7.5