X3DObject.RemoveChild

Description

Cuts the hierarchy link of a collection of X3DObject child objects or a single X3DObject child object. Only the child objects that are currently parented to this object are cut, others are ignored. All cut objects are automatically moved under the X3DObject scene root.

C# Syntax

X3DObject.RemoveChild( Object in_collection );

Scripting Syntax

X3DObject.RemoveChild( [Items] );

Parameters

Parameter Type Description
Items X3DObjectCollection or X3DObject An X3DObjectCollection or a single X3DObject

Examples

VBScript Example

NewScene , false
set oRoot = Application.ActiveProject.ActiveScene.Root
set oSphere = oRoot.AddGeometry( "Sphere", "NurbsSurface" )
set oNull1 = oSphere.AddNull()
set oNull2 = oSphere.AddNull()
set oNull3 = oSphere.AddNull()
set oNull4 = oSphere.AddNull()
for each oChild in oSphere.Children
	Application.LogMessage oChild.Name
next
Application.LogMessage "Remove a null "
oSphere.RemoveChild( oNull1 )
for each oChild in oSphere.Children
	Application.LogMessage oChild.Name
next
' Expected results:
'INFO : null
'INFO : null1
'INFO : null2
'INFO : null3
'INFO : Remove a null 
'INFO : null1
'INFO : null2
'INFO : null3