Skip to content

Latest commit

 

History

History
60 lines (50 loc) · 1.31 KB

File metadata and controls

60 lines (50 loc) · 1.31 KB

GetLocPt

Description

Procedure GetLocPt returns the coordinate location of the referenced locus.

PROCEDURE GetLocPt(
				h         : HANDLE;
				VAR pX,pY : REAL);
def vs.GetLocPt(h):
    return p

Parameters

Name Type Description
h HANDLE Handle to locus.
p REAL Coordinates of locus point.

Remarks

(_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.

Examples

VectorScript

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);

Python

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' )

Version

Availability: from All Versions

Category