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 15-02-2011, 18:42
MikeVerDuin
Guest
 
Posts: n/a
Default I need to find the position of all nodes in an object

I've selected a curve called pcurve
I need to find the x y position of all nodes in pcurve.
pcurve has only 4 nodes.

I can't figure out how to call each node and get PositionX or Y

the first nodes x I will call x1 and the y I will call y1
the second nodes I will call x2 and the y I will call y2
and so on.

Any ideas?

Thank you very much for saving my sanity.
Reply With Quote
  #2  
Old 15-02-2011, 20:04
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,791
Blog Entries: 15
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 Node Position

Here is a little help for you:
Code:
Sub GetMyNodePosition()
    Dim s As Shape, n As Node
    Dim x As Double, y As Double
    Dim x1 As Double, y1 As Double
    Dim x2 As Double, y2 As Double
    Dim x3 As Double, y3 As Double
    Dim x4 As Double, y4 As Double
    
    Set s = ActiveShape
    
    If s.Type = cdrCurveShape Then
        For Each n In s.Curve.Nodes
            n.GetPosition x, y
            MsgBox "x: " & x & " y: " & y
        Next n
        
        'or like this
        s.Curve.Nodes(1).GetPosition x1, y1
        s.Curve.Nodes(2).GetPosition x2, y2
        s.Curve.Nodes(3).GetPosition x3, y3
        s.Curve.Nodes(4).GetPosition x4, y4
        
        MsgBox "x1: " & x1 & " y1: " & y1
    End If
End Sub
Best of luck,

-Shelby
Reply With Quote
  #3  
Old 15-02-2011, 21:05
MikeVerDuin
Guest
 
Posts: n/a
Default

Thanks! That is perfect.
Reply With Quote
Reply

Tags
curves, nodes


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
How to find a object info using CQL [again] ljesus7 CorelDRAW/Corel DESIGNER VBA 0 07-09-2010 09:11
Position inch to mm GoodLook CorelDRAW/Corel DESIGNER VBA 2 11-11-2008 00:47
Corel X3 - object properties bar absolute/relative position issue JeffDM General 4 14-11-2006 13:55
Getting the mouse position Rick Randall CorelDRAW/Corel DESIGNER VBA 1 04-12-2002 09:29
Position inch to mm GoodLook Macros/Add-ons 1 31-12-1969 18:33


All times are GMT -5. The time now is 21:41.


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