Procedure GetLocPt returns the coordinate location of the referenced locus.
PROCEDURE GetLocPt(
h : HANDLE;
VAR pX,pY : REAL);def vs.GetLocPt(h):
return p| Name | Type | Description |
|---|---|---|
| h | HANDLE | Handle to locus. |
| p | REAL | Coordinates of locus point. |
(_c_, 2022.01.19) In Python the tuple returned is always bidimensional in the form (0, 0).
Remember to add a third item (0, 0, 0) for usage in the Vector Routines such as Vec2Ang or they will return gibberish.
PROCEDURE TEST;
VAR
pt : VECTOR;
BEGIN
Message( 'Set begin point' );
CallTool( -221 ); { activates the locus tool }
GetLocPt( FSActLayer, pt.x, pt.y );
Message( pt );
END;
Run(TEST);locObj = vs.FSActLayer()
# make sure a locus is selected or there will be an error.
# Due to the nature of Python, CallTool from the example above
# is not usable for fetching LSActLayer in the same running script.
if locObj!= vs.Handle() and vs.GetTypeN( locObj ) == 17:
pt = vs.GetLocPt( locObj )
vs.AlrtDialog( str(pt) )
else:
vs.AlrtDialog( 'Select a locus' )Availability: from All Versions