Difference between pages "IsSurfaceAbove" and "IsUpdatable"

From scripting
(Difference between pages)
Jump to: navigation, search
(Created page with " Function IsSurfaceAbove(BottomObj As Variant, TopObj As Variant) As Boolean If IsUpdatable(BottomObj) = False Or IsUpdatable(TopObj) = False Then IsSurfaceAbove...")
 
(Created page with " Function IsUpdatable(InputObj As Variant) As Boolean On Error GoTo Blast2 MyPart.UpdateObject InputObj IsUpdatable = True Exit Function Blast2: IsUpdatable = False End...")
 
Line 1: Line 1:
  Function IsSurfaceAbove(BottomObj As Variant, TopObj As Variant) As Boolean
+
  Function IsUpdatable(InputObj As Variant) As Boolean
  If [[IsUpdatable]](BottomObj) = False Or [[IsUpdatable]](TopObj) = False Then
+
  On Error GoTo Blast2
    IsSurfaceAbove = False
+
  MyPart.UpdateObject InputObj
    Exit Function
+
  IsUpdatable = True
End If
+
  Exit Function
Dim BMeas
+
  Blast2:
  Set BMeas = TheSPAWorkbench.GetMeasurable(BottomObj)
+
  IsUpdatable = False
  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:04, 22 April 2017

Function IsUpdatable(InputObj As Variant) As Boolean
On Error GoTo Blast2
MyPart.UpdateObject InputObj
IsUpdatable = True
Exit Function
Blast2:
IsUpdatable = False
End Function