Object Model Reference : Classes : N : Node : Methods : Node.Move |
Sub Move([DeltaX As Double], [DeltaY As Double])
Member of Node
The Move method offsets the position of a node relative to its original location.
The following VBA example randomly distorts the selected curve. This macro loops through all nodes and changes their positions by moving each one by a random offset.
Sub Test() |
Dim s As Shape |
Dim n As Node |
Dim dx As Double, dy As Double |
Const Amplitude As Double = 0.5 |
Set s = ActiveShape |
If s.Type = cdrCurveShape Then |
For Each n In s.Curve.Nodes |
dx = (Rnd() - 0.5) * Amplitude |
dy = (Rnd() - 0.5) * Amplitude |
n.Move dx, dy |
Next n |
End If |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.