## Cluster.CenterReference

### Description

Sets or returns the cluster center reference object (an X3DObject). If the reference is set to Nothing, the ClusterCenter operator will be deleted.

### C# Syntax

    // get accessor

    X3DObject rtn = Cluster.CenterReference;

    // set accessor

    Cluster.CenterReference = X3DObject;

### Examples

#### VBScript Example

    '

    ' This example adds and removes the center references on clusters

    '

    set oCone = Application.ActiveProject.ActiveScene.Root.AddGeometry("Cone","MeshSurface")

    set oNull = Application.ActiveProject.ActiveScene.Root.AddNull

    set oCylinder = Application.ActiveProject.ActiveScene.Root.AddGeometry("Cylinder","MeshSurface")

    set oGrid = Application.ActiveProject.ActiveScene.Root.AddGeometry("Grid","MeshSurface")

    set oCluster = oGrid.ActivePrimitive.Geometry.AddCluster(siPolygonCluster, "PolygonClusterOnGrid", array(59,60,61))

    set oCluster2 = oGrid.ActivePrimitive.Geometry.AddCluster(siEdgeCluster, "EdgeClusterOnGrid", array(20,21,22,23,24,36,38,39))

    set oCluster3 = oGrid.ActivePrimitive.Geometry.AddCluster(siVertexCluster, "VextexClusterOnGrid", array(4,5,6))

    set oCluster3.CenterReference = oCone

    set oClsRef3 = oCluster3.CenterReference

    LogMessage "The cluster center of " & oCluster3.Name & " : " & oClsRef3.Name & ", " & typename(oClsRef3)

    set oCluster.CenterReference = oNull

    set oClsRef = oCluster.CenterReference

    LogMessage "The cluster center of " & oCluster.Name & " : " & oClsRef.Name & ", " & typename(oClsRef)

    set oCluster2.CenterReference = oCylinder

    set oClsRef2 = oCluster2.CenterReference

    LogMessage "The cluster center of " & oCluster2.Name & " : " & oClsRef2.Name & ", " & typename(oClsRef2)

    LogMessage "Finding the operators on " & oGrid.Name

    set CH = oGrid.ActivePrimitive.ConstructionHistory

    LogMessage typename(CH)

    for each op in CH

    	LogMessage op.Name & ", " & op.Type

    next

    set oCluster3.CenterReference = Nothing

    set oClsRef4 = oCluster3.CenterReference

    LogMessage typename(oClsRef4)

    LogMessage "Finding the operators on " & oGrid.Name

    set CH = oGrid.ActivePrimitive.ConstructionHistory

    LogMessage typename(CH)

    for each op in CH

    	LogMessage op.name & ", " & op.type

    next