Geometry1D.AveragePosition
 
 
 

Geometry1D.AveragePosition

Description

Get the average position of given 1D geometry

Scripting Syntax

Geometry1D.AveragePosition( compIdxArray, compPos );

Parameters

Parameter Type Description
compIdxArray Array of Integer values An array of indices of 1D geometry

Possible Values:

Description:

0 <= compIdxArray(i) < Number of 1D geometry Each index in the array must be valid
compPos SIVector3 Upon return, contains the average position of the given 1D geometry

Examples

VBScript Example

'Create a cube
CreatePrim "Cube", "MeshSurface"
set oSelList = GetValue("SelectionList")
set oItem = oSelList(0)
set oGeometry = oItem.obj
oNb1D = oGeometry.Nb1D
set o1DGeometry = oGeometry.Geometry1D
set oPos = XSIMath.CreateVector3()
' Construct an array containing the indices 0,1,2,3
dim oIndicesArray
oIndicesArray = Array( 0, 1, 2, 3 )
o1DGeometry.AveragePosition oIndicesArray, oPos
LogMessage "Average position of Component (0, 1, 2, 3) : " & oPos.x & " | " & oPos.y & " | " & oPos.z

See Also

Geometry1D.ExtremitiesPositions Geometry_V1.Geometry1D SIVector3