Hi WCrihfield .
Thank you for your reply.
That answers my question. Attached is the code derived from yours that I used to do my testing if that might help anyone in the future. The values correspond to those in the solid properties window.
Vincent.
If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kPartDocumentObject Then
MsgBox("This rule only works for Part Documents.",vbOKOnly, "WRONG DOCUMENT TYPE")
Exit Sub
End If
Dim oPDoc As PartDocument = ThisApplication.ActiveDocument
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oWP As WorkPoint
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oBodies As SurfaceBodies = oPDef.SurfaceBodies
Dim oBody As SurfaceBody
Dim oCorner As Point, oD1, oD2, oD3 As Vector
Dim oC1, oC3, oCP As Point
Dim oL1 As LineSegment
Dim oHalfVector As Vector
oBody = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartBodyFilter," Select Body")
oBody.OrientedMinimumRangeBox.GetOrientedBoxData(oCorner, oD1, oD2, oD3)
oC1 = oCorner.Copy
oC1.TranslateBy(oD1)
oC3 = oCorner.Copy
oC3.TranslateBy(oD3)
oL1 = oTG.CreateLineSegment(oC1, oC3)
oCP = oL1.MidPoint.Copy
oHalfVector = oD2.Copy
oHalfVector.ScaleBy(.5)
oCP.TranslateBy(oHalfVector)
MessageBox.Show("X : " & Round(oCP.X*10,3) & " Y : " & Round(oCP.Y*10,3) & " Z : " & Round(oCP.Z*10,3))