Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to test if shapes intersect?

54 views
Skip to first unread message

Guus

unread,
Nov 29, 2004, 9:24:19 AM11/29/04
to corel.graphic_apps.cdgs11-draw

I'm rather new to VBA for CorelDraw!.

In my script I need to test if some shapes intersect or not. I could not
find any function for testing this. Now I try to intersect shapes, but if
they don't I get a warning message. The script will stop and wait until the
warning message is clicked.

The idea is to test if a shape intersects with another shape and if it does,
take action to move one of the shapes.

Sub Main()
Dim s1 As Shape
Dim s2 As Shape
Dim s3 As Shape

Set s1 = getShape("M1", cdrTextShape)
Set s2 = getShape("M2", cdrEllipseShape)

Set s3 = s1.Intersect(s2, True, True) ' this returns a warning if the
shapes do not intersect
End Sub

Thanks for your support
Guus

0 new messages