jzecha
Aerospace
- Jan 20, 2016
- 236
How do I get the COG of a surface?
I have tried the code below a few different ways and I couldn't get it to work.
It fails on the last line with:
"The Method GetCOGPosition Failed"
I believe this code is for Solids and Not Surfaces, but I cant find one for Surfaces.
Any direction would be greatly appreciated.
Code:
Dim oSPAWorkbench As SPAWorkbench
Dim oMeasureable As Measurable
Dim oInertias As Inertias
Dim oInertia 'As Inertia
Dim COGArray(2)
Set oSPAWorkbench = oPartDocument.GetWorkbench("SPAWorkbench")
Set oInertias = oSPAWorkbench.Inertias
oInertias.Add oBodySelectRef
Set oInertia = oInertias.Item(1)
oInertia.GetCOGPosition COGArray