避免在 Corel 绘图中重叠曲线
Avoid overlapping curves in Corel draw
我的 Corel 绘图文件中有很多圆(曲线),我正在寻找一种方法来自动删除重叠的曲线。有没有脚本或其他方法可以做到这一点?
以下代码仅删除顶部的重叠形状:
Sub RemoveOverlappedShapesBis()
Dim sh As Shape, s As Shape, sR As Shape, shR As ShapeRange, d As Document, shrR As New ShapeRange, i As Long
Set d = ActiveDocument
Set shR = d.ActiveLayer.Shapes.All
For Each sh In shR.Shapes
For Each s In shR.Shapes
If shR.IndexOf(sh) <> shR.IndexOf(s) Then
If sh.DisplayCurve.IntersectsWith(s.DisplayCurve) Then
If s.ZOrder > sh.ZOrder Then
If shrR.Count > 0 Then
For Each sR In shrR.Shapes
If shrR.IndexOf(s) = 0 Then
shrR.Add s: Exit For
End If
Next
Else
shrR.Add s
End If
End If
End If
End If
Next
Next
shrR.Shapes.All.Delete
End Sub
我的 Corel 绘图文件中有很多圆(曲线),我正在寻找一种方法来自动删除重叠的曲线。有没有脚本或其他方法可以做到这一点?
以下代码仅删除顶部的重叠形状:
Sub RemoveOverlappedShapesBis()
Dim sh As Shape, s As Shape, sR As Shape, shR As ShapeRange, d As Document, shrR As New ShapeRange, i As Long
Set d = ActiveDocument
Set shR = d.ActiveLayer.Shapes.All
For Each sh In shR.Shapes
For Each s In shR.Shapes
If shR.IndexOf(sh) <> shR.IndexOf(s) Then
If sh.DisplayCurve.IntersectsWith(s.DisplayCurve) Then
If s.ZOrder > sh.ZOrder Then
If shrR.Count > 0 Then
For Each sR In shrR.Shapes
If shrR.IndexOf(s) = 0 Then
shrR.Add s: Exit For
End If
Next
Else
shrR.Add s
End If
End If
End If
End If
Next
Next
shrR.Shapes.All.Delete
End Sub