OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   Keeping Origin bottom left (http://forum.oberonplace.com/showthread.php?t=24672)

knowbodynow 26-04-2014 19:21

Keeping Origin bottom left
I have a macro that amongst other things resizes the page and adds some guidelines. I have lots of A5 documents and when I run it on one of them for some reason the origin is changing so that 0 is no longer in the bottom left corner. This hasn't happened to me before. Why would this change on one document and not the others? Is there anything I can add to my macro to force it to keep bottom left the origin for the rulers. I tried:


  ActiveDocument.DrawingOriginX = 0
  ActiveDocument.DrawingOriginY = 0

But it didn't seem to have any effect.

knowbodynow 26-04-2014 23:43

Since when has 0 been the document center? This works but it's a faff:


ActiveDocument.DrawingOriginX = 0 - (ActivePage.SizeWidth / 2)
ActiveDocument.DrawingOriginY = 0 - (ActivePage.SizeHeight / 2)

Was it like this prior to X6, thanks.

Alex 05-05-2014 02:44

In VBA, the document origin of (0,0) was always in the center of the page. And the lower left corner as you guessed is (-page_width/2, -page_height/2). Once you set Document.DrawingOriginX/Y, then all the rest of API calls will be relative that point. So maybe that's why you are confused. Since all the methods like Layer.CreateRectangle are normally relative to lower left corner of the page simply because the proper drawing origin is set beforehand...

All times are GMT -5. The time now is 22:18.

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