![]() |
![]() |
Node.SetPosition
Sub SetPosition(PositionX As Double, PositionY As Double)
Member of Node
The SetPosition method moves a node to the specified horizontal and y-coordinates.
The GetPosition method returns the horizontal and y-coordinates of a node.
The following code example distorts the selected curve. The amount of distortion depends on the distance between the node and the center of the shape. The node is moved only radially.
Sub Test() Dim s As Shape Dim n As Node Dim xc As Double, yc As Double Dim r As Double Dim dx As Double, dy As Double Const Amplitude As Double = 0.2 Set s = ActiveShape If s.Type = cdrCurveShape Then ActiveDocument.ReferencePoint = cdrCenter s.GetPosition xc, yc For Each n In s.Curve.Nodes dx = n.PositionX - xc dy = n.PositionY - yc r = Exp((Rnd() - 0.5) * Amplitude) n.SetPosition xc + dx * r, yc + dy * r Next n End If End Sub
![]() |
![]() |
![]() |
Copyright 2007 Corel Corporation. All rights reserved.