OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   Setting Drawing Origin in VBA (http://forum.oberonplace.com/showthread.php?t=24635)

nic 06-09-2013 14:21

Setting Drawing Origin in VBA
 
Hi I have been trying to set the origin of a document being created in Draw X6 using the VBA commands

DrawingOriginX = 0
DrawingOriginY = 0

but this dosent seem to be doing anything

Is there a way of setting the rulers origin in VBA or saving a default setting so that new docs use a particular origin?

Thanks
nic

Alex 11-10-2013 21:23

Can you post the actual code you are using? From what you showed, it looks like you are setting two regular variables to zeros.

nic 30-10-2013 08:04

Origin
 
Hi Alex
sorry for the delay in replying. I managed to lose my GMS file upgrading to Win8 so no longer have the original but have just tried to recreate it and seem to have made some progress although still not understanding how the origin is calculated.

On a page 100mm square I thought Coreldraw X6 would by default use the bottom left corner of a page as the origin so that the commands -


Code:

ActiveDocument.DrawingOriginX = 0
ActiveDocument.DrawingOriginY = 0

would set the origin to the bottom left corner of the page, and

Code:

ActiveDocument.Unit = cdrMillimeter 'Set Corel to work in Millimeters
ActiveDocument.DrawingOriginX = 50
ActiveDocument.DrawingOriginY = 50

would set the origin to the centre, BUT on testing it xy=0 sets the drawing origin to the centre and xy=50 sets the origin to the top right.

Can now make it work but dont understand why it works that way.

Any help appreciated,
nic


All times are GMT -5. The time now is 12:40.

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