Here's an ilogic rule to create a workpoint at the CoG. Works well for us!
I believe this was the original source: https://forums.autodesk.com/t5/inventor-forum/center-of-gravity-as-work-point/td-p/2451558
Dim oDoc As Document = ThisDoc.Document
If oDoc.DocumentType = Inventor.DocumentTypeEnum.kDrawingDocumentObject Then
i = MessageBox.Show("The CoG rule is for use in part (ipt) or assembly files (iam) only.", "Wrong Document Type", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1)
ElseIf oDoc.DocumentType = Inventor.DocumentTypeEnum.kPartDocumentObject Or Inventor.DocumentTypeEnum.kAssemblyDocumentObject Then
' Get the Center of Mass.
Dim oCenterOfMass As Point
oCenterOfMass = oDoc.ComponentDefinition.MassProperties.CenterOfMass
' Check to see if a work point for center of mass already exists.
' This uses the name of the work feature to identify it.
On Error Resume Next
Dim oWorkPoint As WorkPoint
oWorkPoint = oDoc.ComponentDefinition.WorkPoints.Item("Center Of Mass")
If Err.Number = 0 Then
Dim oFixedDef As AssemblyWorkPointDef
oFixedDef = oWorkPoint.Definition
oFixedDef.Point = oCenterOfMass
oDoc.Update
Else
' Create a new workpoint at the location of the center of mass.
oWorkPoint = oDoc.ComponentDefinition.WorkPoints.AddFixed(oCenterOfMass)
' Rename the work point.
oWorkPoint.Name = "Center Of Mass"
End If
End If
Cheers