
! script name: points.d/hypoangle
! topic: create point specified distance and angle from a base point

!A
!A NAME:
!A
!A 	Hypotenuse: Angle
!A
!A DESCRIPTION:
!A
!A 	This script creates a point at a specified distance and angle from
!A 	the base point.
!A
!A~ image location - images/hypoangle.jpg
!B INSTRUCTIONS:
!B
!B 	INPUT HYPOTENUSE: Enter the distance (hypotenuse) the point is
!B 		to be created at from the last point described.
!B
!B 	INPUT ANGLE: Enter the angle of the hypotenuse.  Angle is
!B 		referenced from base point.
!B
!B 	INPUT ABS Z: Enter the Z coordinate of the point.
!B

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

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(WsHypoAngle)
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
