Object Model Reference : Classes : N : NodeRange : Methods : NodeRange.RemoveRange |
Sub RemoveRange(NodeRange As NodeRange)
Member of NodeRange
The RemoveRange method removes the nodes in a specified node range from the current node range.
The following VBA example creates a curve and two node ranges. The first node range contains all nodes, and the second node range contains only the cusp nodes. The second node range is removed from the first, leaving only the non-cusp nodes in the first node range.
Sub Test() |
Dim s As Shape |
Dim n As Node |
Dim sp As SubPath |
Dim crv As Curve |
Dim nr1 As NodeRange |
Dim nr2 As New NodeRange |
Set crv = CreateCurve(ActiveDocument) |
ActiveDocument.ReferencePoint = cdrBottomLeft |
Set sp = crv.CreateSubPath(-1, 0.2) |
sp.AppendLineSegment 0.5, 1 |
sp.AppendCurveSegment 2, 3 |
sp.AppendCurveSegment 4, 1 |
sp.AppendCurveSegment 5, 4 |
sp.AppendCurveSegment 7, 2 |
sp.AppendLineSegment 8, 5 |
sp.AppendLineSegment 9, 1 |
sp.Nodes(2).Type = cdrSmoothNode |
sp.Nodes(4).Type = cdrSmoothNode |
Set s = ActiveLayer.CreateCurve(crv) |
Set nr1 = s.Curve.Nodes.All |
For Each n In s.Curve.Nodes |
If n.Type = cdrCuspNode Then |
nr2.Add n |
End If |
Next n |
nr1.RemoveRange nr2 |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.