
! script name: points.d/yhypo
! topic: create point at known Y coordinate and distance from last point

!A
!A NAME:
!A
!A 	Hypotenuse and Y Value
!A
!A DESCRIPTION:
!A
!A 	This script creates a point at a known Y coordinate and
!A 	a specified distance from the base point.
!A 	NOTE: If the specified distance does not intersect the
!A 	      Y coordinate, no point is created.
!A
!A~ image location - images/yhypo.jpg
!B INSTRUCTIONS:
!B
!B 	INPUT ABS Y: Enter the Y coordinate of the point.
!B
!B 	INPUT HYPOTENUSE: Enter the distance (hypotenuse) the point
!B 		is to be created at from the base point.
!B
!B 	INPUT ABS Z: Enter the Z coordinate of the point.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: y: hypotenuse ")

DIM Answer$[256]
DIM Destination$[256]


DEG

ActivateUndo
Base_point:Stat=SetInputFormat("n4","")
Stat= SetAbsIncrInput(WsAbsolute)
Stat=SetXyzInput(WsXyzInput)
Base_point=XyzInput("BASE POINT",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave
Stat=SetLastPoint(Base_point,WsXyzInput)
Stat=SetXyzInput(WsXyzInput)
Stat=SetXyzInput(WsAngleEntity)
Stat= DeleteEntity(Base_point,WsFalse)


Stat=SetXyzInput(WsYandHypo)
Ploop:Pt=XyzInput("INPUT",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave

Stat=SetLastPoint(Pt,WsXyzInput)
ActivateUndo
Stat= AdvanceUndoNumber("point")
Stat= AddItemToUndo(WsUBCreateMode,Pt)
GOTO Base_point

Leave:!
IF Destination$= "BACKUP" THEN Base_point
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
