OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 05-01-2009, 05:27
Posts: n/a
Default How to find centers of objects

Hi, I need an advice. I have an canvas with circles and I need to find the centers of the circles and write a label to each one. The only thing I need is an algorithm with a function to find the coordinates of the circle centers - in VBA. Thanks!
Reply With Quote
Old 06-01-2009, 23:54
shelbym's Avatar
shelbym shelbym is offline
Senior Member
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,782
Blog Entries: 11
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 Centers

This code finds all the ellipses on the page and displays their centers. Hope it helps.
Sub FindCircleCenters()
    Dim s As Shape, srEllipses As ShapeRange
    Dim x As Double, y As Double
    'Find all the Circle / Ellipse Shapes
    Set srEllipses = ActivePage.FindShapes(, cdrEllipseShape)
    'Loop through each Ellipse and display center
    For Each s In srEllipses
        s.Ellipse.GetCenterPosition x, y 'GetCenter
        MsgBox "Center is: x: " & x & " y: " & y 'Display Center
    Next s
End Sub
Best of luck,

Reply With Quote

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
Find and delete objects with no fill or outline keytecstaff CorelDRAW/Corel DESIGNER VBA 17 22-06-2010 23:34
Find bitmaps Wendy Hurst General 2 23-11-2007 14:40
How to find out what colors are used in a document? Alex FAQ 1 16-04-2007 21:07
Where to find logos? Alex FAQ 3 25-10-2005 08:00
Find objects by properties Webster CorelDRAW/Corel DESIGNER VBA 8 01-12-2004 18:51

All times are GMT -5. The time now is 01:51.

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