Autodesk.AutoCAD.Geometry.DoubleCollection sort

Dim dc1 As New DoubleCollection From {
            0,
            7,
            6,
            5,
            8,
            2
        }
        Dim dc2 As New DoubleCollection(dc1.Cast(Of Double)().OrderBy(Function(d) d).ToArray())
        For Each d As Double In dc2
            MsgBox(d)
        Next

同样Point3dCollection的排序:

Dim PTC as As New Point3dCollection
……
PTC = New Point3dCollection(PTC.Cast(Of Point3d)().OrderBy(Function(P As Point3d) P.X).ToArray()) '按X坐标排序





Please follow WeChat's public account ByCAD