OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 29-10-2020, 13:05
jlorbz jlorbz is offline
Junior Member
Join Date: Jun 2009
Posts: 8
Default How would I get the origin point of a rectangle as drawn?

When a user draws a rectangle they can start in any corner and draw the box in any direction.

I'm trying to figure out how to capture which corner of the box (the box's origin) they started with so that I can place a new object banked to that same corner. Thank you for any help you're able to give.

Would I have to cycle through the points and determine which one is which based on the size or is there an easier way to get it?
Reply With Quote
Old 25-11-2020, 14:47
shelbym's Avatar
shelbym shelbym is offline
Senior Member
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,791
Blog Entries: 13
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 Origin Point of Rectangle

The easiest way would be to find the first node of the display curve.

The following will mark the origin point of each rectangle with a red circle:
Sub FindStartofRectange()
    Dim sr As ShapeRange
    Dim s As Shape
    Dim x As Double, y As Double
    Set sr = ActiveSelectionRange
    For Each s In sr.Shapes
        s.DisplayCurve.Nodes.First.GetPosition x, y
        ActiveLayer.CreateEllipse2(x, y, 0.125).Fill.UniformColor.RGBAssign 255, 0, 0
    Next s
End Sub
Happy Coding,

Reply With Quote

box, draw, origin, rectangle, vba

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
Keeping Origin bottom left knowbodynow CorelDRAW/Corel DESIGNER VBA 2 05-05-2014 03:44
Setting Drawing Origin in VBA nic CorelDRAW/Corel DESIGNER VBA 2 30-10-2013 09:04
double click to add point.. flyer CorelDRAW/Corel DESIGNER VBA 5 13-12-2007 17:54
draw nodes at crossing point between a line and a rectangle joyJOYJOY Corel Photo-Paint VBA 1 01-08-2007 14:18
Pick a Point met CorelDRAW/Corel DESIGNER VBA 1 02-11-2005 08:31

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