View Single Post
Old 23-09-2008, 22:01
shelbym's Avatar
shelbym shelbym is offline
Senior Member
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,788
Blog Entries: 12
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default All about nodes...

The best information you will find about nodes is in the help file. There are several examples for what you want....

Adding a node to a SubPath
 Dim sp As SubPath 
 For Each sp In ActiveShape.Curve.Subpaths 
  sp.AddNodeAt 0.5, cdrRelativeSegmentOffset 
 Next sp
Adding a node to a Segment
Dim s As Shape 
 Set s = ActiveLayer.CreateCurveSegment(2, 8.3, 5.3, 8.5, 1.5, -62, 
2.4, 84) 
 s.Curve.Segments(1).AddNodeAt 0.5, cdrRelativeSegmentOffset
Delete a Node
 Dim s As Shape 
 Dim n As Node 
 Dim i As Long, Num As Long 
 Set s = ActiveShape 
 If s.Type <> cdrCurveShape Then Exit Sub 
 Num = s.Curve.Nodes.Count 
 i = 1 
 While i <= Num 
  Set n = s.Curve.Nodes(i) 
  If n.Type = cdrCuspNode Then 
   If n.SubPath.Nodes.Count = 2 Then 
    ' Deleting a node from a segment containing only 2 nodes 
    ' will remove the whole segment. If we are deleting the last 
    ' node of the subpath, then we must move one more step back. 
    If n.SubPath.EndNode Is n Then i = i - 1 
    Num = Num - 2 
    i = i - 1 
    ' Just delete the node and adjust the number of nodes left. 
    Num = Num - 1 
    i = i - 1 
   End If 
  End If 
  i = i + 1 
There are many many more examples that should help you out in the help file!

Reply With Quote