KeepCurveSplitByLength

From scripting
Jump to: navigation, search
Sub KeepLongestSplit(InputSpl As HybridShapeSplit, ForSmaller0ForBigger1 As Integer)
MyPart.UpdateObject InputSpl
Dim HMeas
Set HMeas = theSPAWorkbench.GetMeasurable(InputSpl)
Dim FirstDim As Double
FirstDim = HMeas.Length
InputSpl.InvertOrientation
MyPart.UpdateObject InputSpl
Dim SecondDim As Double
SecondDim = HMeas.Length
If ForSmaller0ForBigger1 = 1 Then
    If FirstDim > SecondDim Then
        InputSpl.InvertOrientation
        MyPart.UpdateObject InputSpl
    End If
else
    If FirstDim < SecondDim Then
        InputSpl.InvertOrientation
        MyPart.UpdateObject InputSpl
    End If
End Sub