Difference between pages "IsSpace" and "IsSurfaceAbove"
From scripting
(Difference between pages)
(Created page with " Function IsSpace(Obj1 As Variant) As Boolean On Error GoTo Blast Dim HHH As ArcSpace Set HHH = Obj1 IsSpace = True Exit Function Blast: IsSpace = False End Function...") |
(Created page with " Function IsSurfaceAbove(BottomObj As Variant, TopObj As Variant) As Boolean If IsUpdatable(BottomObj) = False Or IsUpdatable(TopObj) = False Then IsSurfaceAbove...") |
||
Line 1: | Line 1: | ||
− | Function | + | Function IsSurfaceAbove(BottomObj As Variant, TopObj As Variant) As Boolean |
− | + | If [[IsUpdatable]](BottomObj) = False Or [[IsUpdatable]](TopObj) = False Then | |
− | Dim | + | IsSurfaceAbove = False |
− | Set | + | 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 | End Function | ||
− | |||
[[Category:CATIA DP VB]] | [[Category:CATIA DP VB]] |
Latest revision as of 07:03, 22 April 2017
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