Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
MBIMO
Posted - 09/01/2005 : 11:53:34 AM Origin Version (Select Help-->About Origin): 7.5 SR5 Operating System: Win2k
Hello everybody,
currently I'm trying to manipulate the size and position of GraphObjects programmatically. First I tried the Top/Left/Width/Height data fields. But this works only for Top/Left and not for Width/Height since the latter two are readonly. So I switched to the X/Y/DX/DY data fields. However they are using scale units instead of pixels. Since I want to rescale a GraphObject depending of the size of some GraphObjects on another layer, I run into problems the very moment the scale of the layers differs.
Is there maybe a function that converts scale units of a specific layer in pixels or something similar?
Any help is much appreciated.
Best regards,
Martin
The problem that
4 L A T E S T R E P L I E S (Newest First)
Mike Buess
Posted - 09/02/2005 : 07:38:48 AM Martin,
Yes, but leave out LT_execute("using Rect = LabTalk.Rect."). It's not needed and means nothing in LT.
Interestingly the code behaves differently depending on whether it is run from a script window or from OriginC using LT_execute. In the latter case resizing the rectangle changes the position of the upper left corner. However, setting first "Width" and "Height" and then "Top" and "Left" solves the problem.
Thanks again,
Martin
Edited by - MBIMO on 09/01/2005 6:04:26 PM
Mike Buess
Posted - 09/01/2005 : 3:37:50 PM Hi Martin,
quote:But this works only for Top/Left and not for Width/Height since the latter two are readonly.
I see that's correct but it's odd since the corresponding LabTalk properties are read/write. If the graph object is in the active layer you can do things like this (assuming a rectangle for illustration)...
using Rect = LabTalk.Rect; Rect.Top = 10; Rect.Left = 10; Rect.Width = 1000; Rect.Height = 500;