SubComponent.RemoveElement
 
 
 

SubComponent.RemoveElement

Description

Removes an element from the SubComponent by its index. All subelements can be removed except isolines and isopoints (because those are not indexable subelements). That means that if you want to remove a Vertex from a siVertexCluster (from the ClusterTypes enum) you call RemoveElement with the index of the Vertex in the Geometry.

C# Syntax

SubComponent.RemoveElement( Object in_Elem );

Scripting Syntax

SubComponent.RemoveElement( Element );

Parameters

Parameter Type Description
Element Double Index of the element that we want to remove from the SubComponent element.

Examples

VBScript Example

'
' This example demonstrates how to remove an element by index number.
' It also shows what happens when you try to remove an element that
' is not part of the SubComponent and what happens when you
' try to remove an element using an invalid index number.
'
NewScene , false
set oObject = Application.ActiveSceneRoot.AddGeometry( "Cube","MeshSurface","MyCube" )
set oSubComponent = oObject.ActivePrimitive.Geometry.CreateSubComponent( siVertexCluster, Array(3,4,6) )
Application.LogMessage oSubComponent
' Remove vertex index 6 from the subcomponent
oSubComponent.RemoveElement 6
Application.LogMessage oSubComponent
' No change to the SubComponent since the vertex at index 7 was not part of it
oSubComponent.RemoveElement 7
Application.LogMessage oSubComponent
' No change to the SubComponent since index 55 is not a valid vertex index
oSubComponent.RemoveElement 55
Application.LogMessage oSubComponent
' Expected results:
'INFO : MyCube.pnt[3,4,6]
'INFO : MyCube.pnt[3,4]
'INFO : MyCube.pnt[3,4]
'INFO : MyCube.pnt[3,4]