ActiveDocument.Unit = cdrMillimeter
On Error Resume Next
Dim nod As Node, nodr As NodeRange, seg As Segment
Dim sl As Shape, x As Double, y As Double, a1 As Double
Dim dx As Double, dy As Double, a2 As Double
Dim i As Long
Set nodr = ActiveShape.Curve.Selection
If nodr.Count > 1 Then MsgBox "请选择一个节点后重试", vbExclamation, "aa": Exit Sub
If nodr.Count < 1 Then MsgBox "请选择一个节点后重试", vbExclamation, "aa": Exit Sub
For Each nod In ActiveShape.Curve.Selection
' nod.Segment.GetPerpendicularAt
nod.GetPosition x, y
a2 = nod.Segment.GetPerpendicularAt(1, cdrRelativeSegmentOffset) * 3.1415926 / 180
Next nod
dx = 50 * Cos(a2)
dy = 50 * Sin(a2)
ActiveLayer.CreateLineSegment x - dx, y - dy, x + dx, y + dy
ActiveShape.Outline.Color.CMYKAssign 0, 60, 100, 0
CorelDRAW vba cdr插件 节点添加垂直线
于 2024-12-31 13:15:39 首次发布