OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-07-2014, 13:24
LeonoCoder LeonoCoder is offline
Junior Member
 
Join Date: Nov 2006
Posts: 10
Exclamation Getintersections - crash CorelDraw 17.1.0.572

CorelDraw X7 17.1.0.572 (32 and 64 bits) crashes when you try to get the intersections of two segments of one curve (example: segment 1 and segment 2)
- It does not crash if you get the intersections between two segments of two different curves.
- It does not crash with CorelDraw X7 17.0 or older versions
- error module: vgcore.dll
GetIntersections()

Code:
Sub Test()
 'Draw a rectangle or an ellipse and convert to curves first.
 Dim seg1 As Segment, seg2 As Segment
 Dim cps As CrossPoints, cp As CrossPoint
 Dim x As Double, y As Double
 If ActiveShape Is Nothing Then
  MsgBox "Nothing selected", vbCritical
  Exit Sub
 End If
 If ActiveShape.Type <> cdrCurveShape Then
  MsgBox "Select a curve", vbCritical
  Exit Sub
 End If
 If ActiveShape.Curve.Segments.Count < 2 Then
  MsgBox "The curve must have more than 1 segments", vbCritical
  Exit Sub
 End If
 Set seg1 = ActiveShape.Curve.SubPaths(1).Segments(1)
 Set seg2 = ActiveShape.Curve.SubPaths(1).Segments(2)
 Set cps = seg1.GetIntersections(seg2) ' HERE CORELDRAW X7 CRASHES
 For Each cp In cps
  ActiveLayer.CreateEllipse2 cp.PositionX, cp.PositionY, 0.05
 Next cp
 MsgBox cps.Count & " intersection point(s) found"
End Sub

Last edited by LeonoCoder; 02-07-2014 at 16:33.
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
VBA Segment GetIntersections thira CorelDRAW/Corel DESIGNER VBA 0 18-11-2006 02:16
Imort Tif- X3 Crash gperzel General 5 19-07-2006 08:44
crash when exporting .eps's bloodgroove General 3 08-02-2006 14:25
crash lizrathke General 1 18-05-2005 18:59
How can GetIntersections to add a node on a curve? lees CorelDRAW/Corel DESIGNER VBA 6 05-10-2004 07:27


All times are GMT -5. The time now is 15:47.


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