KeepHighestLevel

From scripting
Revision as of 07:06, 22 April 2017 by Nickpisca (talk | contribs) (Created page with " Sub KeepHighestLevel(LevelPlane As HybridShapePlaneOffset, TestPtObj As Variant) If IsUpdatable(LevelPlane) And IsUpdatable(TestPtObj) Then Dim OrigOri As Integer...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Sub KeepHighestLevel(LevelPlane As HybridShapePlaneOffset, TestPtObj As Variant)
If IsUpdatable(LevelPlane) And IsUpdatable(TestPtObj) Then
    Dim OrigOri As Integer
    OrigOri = LevelPlane.Orientation
    Dim OppOri As Integer
    OppOri = (-1) * OrigOri
    
    Dim TMeas
    Set TMeas  = TheSPAWorkbench.GetMeasurable(TestPtObj)
    Dim OrigPt Coords(2)
    TMeas.GetPoint OrigPtCoords
    
    LevelPlane.Orientation = OppOri
    IsUpdatable TestPtObj
    Dim TMeas2
    Set TMeas2 = TheSPAWorkbench.GetMeasurable(TestPtObj)
    Dim OppPtCoords(2)
    TMeas2.GetPoint OppPtCoords
    
    If OppPtCoords(2) < OrigPtCoords(2) Then
        LevelPlane.Orientation = OrigOri
        IsUpdatable TestPtObj
    End If
End If
End Sub