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 16-09-2007, 10:09
joyJOYJOY
Guest
 
Posts: n/a
Default add node problem

Dear Sir,

Can anybody help me about create nodes at crossing point between a line and a rectangle when they are overlapping by corel vba ? Please help
Reply With Quote
  #2  
Old 16-09-2007, 11:30
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,769
Blog Entries: 9
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 CrossPoints

Have a look at this example.
Code:
Sub FindCrossPoints()
    Dim s1 As Shape, sr As New ShapeRange
    Dim s As Shape
    Dim cps As CrossPoints
    Dim cp As CrossPoint

    sr.Add ActiveLayer.CreateEllipse2(4, 4, 3)
    sr.Add ActiveLayer.CreateEllipse2(5, 3, 2)

    Set s = sr.Combine

    Set cps = s.Curve.SubPaths(1).GetIntersections(s.Curve.SubPaths(2))

    For Each cp In cps
        ActiveLayer.CreateEllipse2 cp.PositionX, cp.PositionY, 0.1
    Next cp
End Sub
-Shelby
Reply With Quote
  #3  
Old 21-03-2011, 10:56
kobe
Guest
 
Posts: n/a
Default Crosspoints

how to add a node?
Reply With Quote
  #4  
Old 21-03-2011, 20:12
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
You must change the offset parameter to absolute and calculate the distance. Here's some old code from Alex.

Code:
Sub Macro1()
    Dim s1 As Shape
    Dim s2 As Shape
    Dim cps As CrossPoints
    Dim cp As CrossPoint
    Dim sp1 As SubPath
    Dim sp2 As SubPath
    
    Set s1 = ActiveLayer.CreateEllipse2(2.36889, 5.814937, 1.166118, -1.166118)
    s1.ConvertToCurves
    Set sp1 = s1.Curve.SubPaths(1)
    Set s2 = ActiveLayer.CreateEllipse2(4.284047, 6.402252, 1.464031, -1.464031)
    s2.ConvertToCurves
    Set sp2 = s2.Curve.SubPaths(1)
    
    Set cps = sp1.GetIntersections(sp2, cdrAbsoluteSegmentOffset)
    For Each cp In cps
        sp1.AddNodeAt cp.Offset, cdrAbsoluteSegmentOffset
    Next cp
End Sub
-John
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
Problem using "GetUserClick" with Snap? Jon Lorber CorelDRAW/Corel DESIGNER VBA 3 12-06-2006 12:47
text node problem mudhen General 3 17-07-2005 12:01
Node Mover ddonnahoe Code Critique 6 23-02-2005 17:33
vba question bumblebee CorelDRAW/Corel DESIGNER VBA 4 04-08-2004 16:07
Problem with Export (or Save as) in AI-Format LOT CorelDRAW/Corel DESIGNER VBA 3 10-02-2004 15:28


All times are GMT -5. The time now is 16:37.


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