OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 21-09-2008, 13:32
Sablesword Sablesword is offline
Junior Member
 
Join Date: Aug 2006
Posts: 20
Default VBA Nodes Tutorial

Is there a good tutorial anywhere for working with nodes in Coreldraw VBA?

The "record a macro" trick gives me a good starting point for many uses of VBA, but not for creating, deleting, & otherwise manipulating nodes.
Reply With Quote
  #2  
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
Code:
 Dim sp As SubPath 
 For Each sp In ActiveShape.Curve.Subpaths 
  sp.AddNodeAt 0.5, cdrRelativeSegmentOffset 
 Next sp
Adding a node to a Segment
Code:
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
Code:
 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 
    n.Delete 
    Num = Num - 2 
    i = i - 1 
   Else 
    ' Just delete the node and adjust the number of nodes left. 
    n.Delete 
    Num = Num - 1 
    i = i - 1 
   End If 
  End If 
  i = i + 1 
 Wend
There are many many more examples that should help you out in the help file!

-Shelby
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Joining Nodes Help Needed Dart CorelDRAW/Corel DESIGNER VBA 2 29-11-2006 18:18
looking for a tutorial link DrStein99 CorelDRAW/Corel DESIGNER VBA 4 23-02-2006 11:16
problems with nodes jmalmsteen CorelDRAW/Corel DESIGNER VBA 1 14-06-2005 13:23
It is a bug? (Reflecting Nodes) Hernán General 0 26-10-2004 02:13
Too many nodes ddonnahoe CorelDRAW/Corel DESIGNER VBA 3 27-02-2004 08:14


All times are GMT -5. The time now is 20:59.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com