IsSurfaceAbove

From scripting
Jump to: navigation, search
Function IsSurfaceAbove(BottomObj As Variant, TopObj As Variant) As Boolean
If IsUpdatable(BottomObj) = False Or IsUpdatable(TopObj) = False Then
    IsSurfaceAbove = False
    Exit Function
End If
Dim BMeas
Set BMeas = TheSPAWorkbench.GetMeasurable(BottomObj)
Dim TMeas
Set TMeas = TheSPAWorkbench.GetMeasurable(TopObj)

Dim BCoord(2)
Dim TCoord(2)
BMeas.GetCOG BCoord
TMeas.GetCOG TCoord
If BCoord(2) < TCoord(2) Then
    IsSurfaceAbove = True
Else
    IsSurfaceAbove = False
End If
End Function