VS:GetOrigin: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
(update infos, removed very confusing obsolete remarks) |
||
Line 38: | Line 38: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark> | <remark> | ||
([[User:Orso.b.schmid|Orso]], 2015.05.31): | |||
For many years this function failed to return the origin shift when used from within plug-in objects (tested up to VW 2009).This is not the case any longer. At least since VW 2011 it returns the origin shift both from within PIOs and from Commands. | |||
Objects inside Symbols use the reverse of the User Origin. I added a table of the values related to VectorScript origin in the article [http://www.vectorlab.info/index.php?title=Absolute_Origin#Available_routines:Link Absolute Origin], by Gerard Jonker, on VectorLab. | Objects inside Symbols use the reverse of the User Origin. I added a table of the values related to VectorScript origin in the article [http://www.vectorlab.info/index.php?title=Absolute_Origin#Available_routines:Link Absolute Origin], by Gerard Jonker, on VectorLab. | ||
Line 61: | Line 50: | ||
PROCEDURE Example; | PROCEDURE Example; | ||
VAR | VAR | ||
originPt :VECTOR; | originPt : VECTOR; | ||
BEGIN | BEGIN | ||
GetOrigin(originPt.x, originPt.y); | GetOrigin(originPt.x, originPt.y); | ||
Line 67: | Line 56: | ||
END; | END; | ||
RUN(Example);</code> | RUN(Example);</code> | ||
==== Python ==== | ==== Python ==== | ||
<code lang="py"> | <code lang="py"> |
Revision as of 06:29, 31 May 2015
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Procedure GetOrigin returns the current origin location relative to the center of the page.
PROCEDURE GetOrigin(
VAR x :REAL;
VAR y :REAL);
def vs.GetOrigin(): return (x, y)
Parameters
x REAL Returns X coordinate of origin. y REAL Returns Y coordinate of origin.
Remarks
(Orso, 2015.05.31):
For many years this function failed to return the origin shift when used from within plug-in objects (tested up to VW 2009).This is not the case any longer. At least since VW 2011 it returns the origin shift both from within PIOs and from Commands.
Objects inside Symbols use the reverse of the User Origin. I added a table of the values related to VectorScript origin in the article Absolute Origin, by Gerard Jonker, on VectorLab.
Example
VectorScript
PROCEDURE Example; VAR originPt : VECTOR; BEGIN GetOrigin(originPt.x, originPt.y); Message(originPt); END; RUN(Example);
Python
def Example(): originPtX, originPtY = vs.GetOrigin() vs.Message(originPtX, originPtY); Example()
Version
Availability: from All Versions