Previous Document Next Document
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.

Parameters
Description
DeltaX
Specifies the horizontal offset
This parameter is optional, and its default value is 0.
DeltaY
Specifies the vertical offset
This parameter is optional, and its default value is 0.

The following code example randomly distorts the selected curve. This macro loops through all of the nodes and changes their positions by moving each node 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 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.