## Geometry2D.CenterPosition

### Description

Get the position of a given 2D geometry

### Scripting Syntax

    Geometry2D.CenterPosition( compIdx, compPos );

### Parameters

Parameter | Type | Description
--- | --- | ---
compIdx | Integer | Index of the component
Possible Values: | Description:
0 <= compIdx < Number of 2D Component | The compIdx must be valid
compPos | SIVector3 | Upon return, contains the position of the (compIdx)th 2D component

### Examples

#### VBScript Example

    'Create a cube
    CreatePrim "Cube", "MeshSurface"
    set oSelList = GetValue("SelectionList")
    set oItem = oSelList(0)
    set oGeometry = oItem.obj
    oNb2D = oGeometry.Nb2D
    set o2DComponent = oGeometry.Geometry2D
    set oPos = XSIMath.CreateVector3()
    ' Loop on all the 2D Component
    for i = 0 to oNb2D - 1
    o2DComponent.CenterPosition i, oPos
    LogMessage "Component [" & i & "] center position : " & oPos.x & " | " & oPos.y & " | " & oPos.z
    next

### See Also

Geometry2D.AveragePosition Geometry2D Geometry_V1.Nb2D SIVector3