![]() |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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? |
#2
|
||||
|
||||
![]()
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: Code:
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 -Shelby |
![]() |
Tags |
box, draw, origin, rectangle, vba |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |