Here's the text of a macro that inserts a point at the CG, and updates it every time the macro is run. To have this update on every rebuild, you would need to re-implement this as a macro feature. There is no way to do this other than manually or with programming.
Beware word wrap:
' ***********************************************************************
******* ' C:\DOCUME~1\dshoebri\LOCALS~1\Temp\swx284\Macro1.swb - macro ' recorded on 07/12/02 by Dshoebri '
***********************************************************************
*******
Dim swApp As Object Dim objDoc As Object Dim status As Long Dim CG_3DSketch As Object Dim objNewPoint As Object Dim ObjSelectionMgr As Object Dim objSketchToRename As Object Dim objCG_Point As Object Dim objSketch As Object Dim objSketchPoint As Object
Sub main() Set swApp = CreateObject("SldWorks.Application") Set objDoc = swApp.ActiveDoc MassProperties = objDoc.GetMassProperties2(status) On Error Resume Next X_pt = MassProperties(0) If Err 0 Then X_pt = 0 Y_pt = 0 Z_pt = 0 Else Y_pt = MassProperties(1) Z_pt = MassProperties(2) End If On Error GoTo 0
CG_3DSketch_Name = "Center-Of-Gravity" Set CG_3DSketch = objDoc.FeatureByName(CG_3DSketch_Name) On Error Resume Next Junk = CG_3DSketch.Name If Err 0 Then On Error GoTo 0 objDoc.Insert3DSketch objDoc.CreatePoint2 X_pt, Y_pt, Z_pt objDoc.Insert3DSketch Set objNewPoint = objDoc.FeatureByPositionReverse(0) objDoc.FeatureByPositionReverse(0).Name = CG_3DSketch_Name Set objNewPoint = objDoc.FeatureByPositionReverse(0) objDoc.EditRebuild Else On Error GoTo 0 objDoc.SelectById CG_3DSketch_Name, "SKETCH", 0, 0, 0 objDoc.EditSketch Set objSketch = objDoc.GetActiveSketch2 SketchPointArray = objSketch.GetSketchPoints PointCount = UBound(SketchPointArray) + 1 For i = 0 To (PointCount - 1) Set objSketchPoint = SketchPointArray(i) Junk = objSketchPoint.SetCoords(X_pt, Y_pt, Z_pt) Next i objDoc.EditRebuild End If End Sub