'
' 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]
|