VS:HAngle: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 5: | Line 5: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<desc> | <desc> | ||
Function HAngle returns the angle of the referenced | Function HAngle returns the angle of the referenced object. | ||
</desc> | </desc> | ||
Line 42: | Line 42: | ||
On round walls the eventual reversion is NOT detected. Check if the wall is counterclockwise: | On round walls the eventual reversion is NOT detected. Check if the wall is counterclockwise: | ||
<code lang="pas"> | <code lang="pas"> | ||
IF NOT | IF NOT GetObjectVariableBool(wallH, 570) THEN | ||
wallRot := -wallrot; | wallRot := -wallrot; | ||
</code> | </code> |
Latest revision as of 10:04, 20 July 2023
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Function HAngle returns the angle of the referenced object.
FUNCTION HAngle(
h :HANDLE) : REAL;
def vs.HAngle(h): return REAL
Parameters
h HANDLE Handle to object.
Return Value
Remarks
You can use this routines for getting the angle (slope) of a straight wall as well.
It will also detect the eventual reversion of the wall, consistent with the OIP.
On round walls the eventual reversion is NOT detected. Check if the wall is counterclockwise:
IF NOT GetObjectVariableBool(wallH, 570) THEN wallRot := -wallrot;
For rotated rectangle and oval, the angle is in range [-180;180].
Example
VectorScript
PROCEDURE Example; BEGIN CallTool(-202); Message(HAngle(FSActLayer)); END; RUN(Example);
Python
def Example(): vs.CallTool(-202) vs.Message(vs.HAngle(vs.FSActLayer())) Example()
Version
Availability: from All Versions