CorelDRAW VBA - 按照面积排序曲线物件(形状)

以下是按照面积对形状进行排序的代码,仅供参考。

Sub 按面积排序曲线物件()
    ' For diaogangxiong
    ActivePage.Shapes.All.CreateSelection’全选
    Dim OrigSelection As ShapeRange
    Set OrigSelection = ActiveSelectionRange
    OrigSelection.ConvertToCurves’转曲线
    Dim grp1 As ShapeRange
    Set grp1 = OrigSelection.UngroupAllEx’解群组
    If grp1.Count > 0 Then
        Dim SS() As Double
        ReDim Preserve SS(grp1.Count - 1)
        Dim n As Long
        For n = 0 To grp1.Count - 1
            SS(n) = grp1(n + 1).Curve.Area
        Next
        Dim a() As Double
        a = SS
        Dim j As Long
        Dim i As Long
        Dim t As Double
        Dim Min As Double
        For i = 0 To UBound(a)
            Min = a(i)
            For j = i + 1 To UBound(a)
                If a(j) < Min Then
                    Min = a(j)
                    t = a(i)
                    a(i) = a(j)
                    a(j
相关推荐
©️2020 CSDN 皮肤主题: 护眼 设计师:闪电赇 返回首页
实付 9.90元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值